|
62 | 62 | require => Package['git'], |
63 | 63 | } |
64 | 64 |
|
65 | | - if $override_template { |
66 | | - file { "${home}/.zshrc": |
| 65 | + if !$ohmyzsh::concat { |
| 66 | + if $override_template { |
| 67 | + file { "${home}/.zshrc": |
| 68 | + ensure => file, |
| 69 | + replace => 'no', |
| 70 | + owner => $name, |
| 71 | + group => $group, |
| 72 | + mode => '0644', |
| 73 | + source => "puppet:///modules/${module_name}/zshrc.zsh-template", |
| 74 | + require => Vcsrepo["${home}/.oh-my-zsh"], |
| 75 | + } |
| 76 | + } else { |
| 77 | + exec { "ohmyzsh::cp .zshrc ${name}": |
| 78 | + creates => "${home}/.zshrc", |
| 79 | + command => "cp ${home}/.oh-my-zsh/templates/zshrc.zsh-template ${home}/.zshrc", |
| 80 | + path => ['/bin', '/usr/bin'], |
| 81 | + onlyif => "getent passwd ${name} | cut -d : -f 6 | xargs test -e", |
| 82 | + user => $name, |
| 83 | + require => Vcsrepo["${home}/.oh-my-zsh"], |
| 84 | + before => File_Line["ohmyzsh::disable_auto_update ${name}"], |
| 85 | + } |
| 86 | + } |
| 87 | + } else { |
| 88 | + file { "${home}/.zshrc.local": |
67 | 89 | ensure => file, |
68 | 90 | replace => 'no', |
69 | 91 | owner => $name, |
70 | 92 | group => $group, |
71 | 93 | mode => '0644', |
72 | | - source => "puppet:///modules/${module_name}/zshrc.zsh-template", |
| 94 | + source => "puppet:///modules/${module_name}/concat/zshrc.local", |
73 | 95 | require => Vcsrepo["${home}/.oh-my-zsh"], |
74 | 96 | } |
75 | | - } else { |
76 | | - exec { "ohmyzsh::cp .zshrc ${name}": |
77 | | - creates => "${home}/.zshrc", |
78 | | - command => "cp ${home}/.oh-my-zsh/templates/zshrc.zsh-template ${home}/.zshrc", |
79 | | - path => ['/bin', '/usr/bin'], |
80 | | - onlyif => "getent passwd ${name} | cut -d : -f 6 | xargs test -e", |
81 | | - user => $name, |
| 97 | + |
| 98 | + concat { "${home}/.zshrc": |
| 99 | + ensure => present, |
| 100 | + owner => $name, |
| 101 | + group => $group, |
| 102 | + mode => '0644', |
82 | 103 | require => Vcsrepo["${home}/.oh-my-zsh"], |
83 | | - before => File_Line["ohmyzsh::disable_auto_update ${name}"], |
| 104 | + } |
| 105 | + |
| 106 | + concat::fragment { "${home}/.zshrc:puppet": |
| 107 | + target => "${home}/.zshrc", |
| 108 | + content => "### This file is managed by Puppet, any changes will be lost\n### Use the file ~/.zshrc.local for your changes\n", |
| 109 | + order => '000', |
| 110 | + } |
| 111 | + |
| 112 | + concat::fragment { "${home}/.zshrc:template-010": |
| 113 | + target => "${home}/.zshrc", |
| 114 | + source => "puppet:///modules/${module_name}/concat/zshrc-010.zsh-template", |
| 115 | + order => '010', |
| 116 | + } |
| 117 | + |
| 118 | + concat::fragment { "${home}/.zshrc:template-030": |
| 119 | + target => "${home}/.zshrc", |
| 120 | + source => "puppet:///modules/${module_name}/concat/zshrc-030.zsh-template", |
| 121 | + order => '030', |
| 122 | + } |
| 123 | + |
| 124 | + concat::fragment { "${home}/.zshrc:template-050": |
| 125 | + target => "${home}/.zshrc", |
| 126 | + source => "puppet:///modules/${module_name}/concat/zshrc-050.zsh-template", |
| 127 | + order => '050', |
| 128 | + } |
| 129 | + |
| 130 | + concat::fragment { "${home}/.zshrc:template-070": |
| 131 | + target => "${home}/.zshrc", |
| 132 | + source => "puppet:///modules/${module_name}/concat/zshrc-070.zsh-template", |
| 133 | + order => '070', |
84 | 134 | } |
85 | 135 | } |
86 | 136 |
|
|
100 | 150 | } |
101 | 151 | } |
102 | 152 |
|
103 | | - file_line { "ohmyzsh::disable_auto_update ${name}": |
104 | | - path => "${home}/.zshrc", |
105 | | - line => "DISABLE_AUTO_UPDATE=\"${disable_auto_update}\"", |
106 | | - match => '.*DISABLE_AUTO_UPDATE.*', |
107 | | - after => '^plugins=', |
| 153 | + if !$ohmyzsh::concat { |
| 154 | + file_line { "ohmyzsh::disable_auto_update ${name}": |
| 155 | + path => "${home}/.zshrc", |
| 156 | + line => "DISABLE_AUTO_UPDATE=\"${disable_auto_update}\"", |
| 157 | + match => '.*DISABLE_AUTO_UPDATE.*', |
| 158 | + after => '^plugins=', |
| 159 | + } |
| 160 | + } else { |
| 161 | + concat::fragment { "${home}/.zshrc:DISABLE_AUTO_UPDATE": |
| 162 | + target => "${home}/.zshrc", |
| 163 | + content => "DISABLE_AUTO_UPDATE=\"${disable_auto_update}\"\n", |
| 164 | + order => '040', |
| 165 | + } |
108 | 166 | } |
109 | 167 |
|
110 | 168 | # Fix permissions on '~/.oh-my-zsh/cache/completions' |
|
0 commit comments