Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: modules/adblockplus/manifests/init.pp

Issue 29469584: #1634 - Update file resource syntax in module adblockplus (Closed)
Patch Set: Created June 20, 2017, 4:42 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | modules/adblockplus/manifests/log.pp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # == Class: adblockplus 1 # == Class: adblockplus
2 # 2 #
3 # The adblockplus class and the associated adblockplus:: namespace are 3 # The adblockplus class and the associated adblockplus:: namespace are
4 # used to integrate Puppet modules with each other, in order to assemble 4 # used to integrate Puppet modules with each other, in order to assemble
5 # the setups used by the Adblock Plus project. 5 # the setups used by the Adblock Plus project.
6 # 6 #
7 # === Parameters: 7 # === Parameters:
8 # 8 #
9 # [*authority*] 9 # [*authority*]
10 # The authorative domain or zone associated with the current environment. 10 # The authorative domain or zone associated with the current environment.
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 stage => 'runtime', 53 stage => 'runtime',
54 } 54 }
55 55
56 # Used as internal constant within adblockplus::* resources 56 # Used as internal constant within adblockplus::* resources
57 $directory = '/var/adblockplus' 57 $directory = '/var/adblockplus'
58 58
59 # A common location for directories specific to the adblockplus:: setups, 59 # A common location for directories specific to the adblockplus:: setups,
60 # managed via Puppet, but accessible by all users with access to the system 60 # managed via Puppet, but accessible by all users with access to the system
61 @file {$directory: 61 @file {$directory:
62 ensure => 'directory', 62 ensure => 'directory',
63 mode => 0755, 63 mode => '0755',
64 owner => 'root', 64 owner => 'root',
65 } 65 }
66 66
67 # A common time-zone shared by all hosts provisioned eases synchronization 67 # A common time-zone shared by all hosts provisioned eases synchronization
68 # and debugging, i.e. log-file review and similar tasks, significantly 68 # and debugging, i.e. log-file review and similar tasks, significantly
69 file { 69 file {
70 '/etc/timezone': 70 '/etc/timezone':
71 content => 'UTC', 71 content => 'UTC',
72 ensure => 'present', 72 ensure => 'present',
73 group => 'root', 73 group => 'root',
74 mode => 0644, 74 mode => '0644',
75 notify => Service['cron'], 75 notify => Service['cron'],
76 owner => 'root'; 76 owner => 'root';
77 '/etc/localtime': 77 '/etc/localtime':
78 ensure => 'link', 78 ensure => 'link',
79 target => '/usr/share/zoneinfo/UTC', 79 target => '/usr/share/zoneinfo/UTC',
80 notify => Service['cron']; 80 notify => Service['cron'];
81 } 81 }
82 82
83 # Explicit resource required only to ensure cron(8) is running; 83 # Explicit resource required only to ensure cron(8) is running;
84 # there is no real requirement for a rationship with another resource 84 # there is no real requirement for a rationship with another resource
85 service {'cron': 85 service {'cron':
86 ensure => 'running', 86 ensure => 'running',
87 enable => true, 87 enable => true,
88 } 88 }
89 89
90 $cron_env = hiera('cron::environment', []) 90 $cron_env = hiera('cron::environment', [])
91 91
92 file { '/etc/crontab': 92 file { '/etc/crontab':
93 ensure => 'present', 93 ensure => 'present',
94 content => template('adblockplus/crontab.erb'), 94 content => template('adblockplus/crontab.erb'),
95 owner => 'root', 95 owner => 'root',
96 group => 'root', 96 group => 'root',
97 mode => 0644, 97 mode => '0644',
98 } 98 }
99 99
100 # Work around https://issues.adblockplus.org/ticket/3479 100 # Work around https://issues.adblockplus.org/ticket/3479
101 if $::environment == 'development' { 101 if $::environment == 'development' {
102 102
103 file { 103 file {
104 '/etc/ssh/ssh_host_rsa_key': 104 '/etc/ssh/ssh_host_rsa_key':
105 source => 'puppet:///modules/adblockplus/development_host_rsa_key', 105 source => 'puppet:///modules/adblockplus/development_host_rsa_key',
106 mode => 600, 106 mode => '600',
mathias 2017/06/20 17:09:02 Now that we're at it, can't we make it uniform and
107 notify => Service['ssh']; 107 notify => Service['ssh'];
108 '/etc/ssh/ssh_host_rsa_key.pub': 108 '/etc/ssh/ssh_host_rsa_key.pub':
109 source => 'puppet:///modules/adblockplus/development_host_rsa_key.pub', 109 source => 'puppet:///modules/adblockplus/development_host_rsa_key.pub',
110 mode => 644; 110 mode => '644';
111 } 111 }
112 } 112 }
113 113
114 # Fix implicit package dependency Class['apt'] does not properly handle 114 # Fix implicit package dependency Class['apt'] does not properly handle
115 Exec['apt_update'] -> Package<|title != 'python-software-properties'|> 115 Exec['apt_update'] -> Package<|title != 'python-software-properties'|>
116 116
117 # https://issues.adblockplus.org/ticket/3574#comment:19 117 # https://issues.adblockplus.org/ticket/3574#comment:19
118 ensure_packages($packages) 118 ensure_packages($packages)
119 119
120 # https://projects.puppetlabs.com/issues/4145 120 # https://projects.puppetlabs.com/issues/4145
121 ensure_resource('file', '/etc/ssh/ssh_known_hosts', { 121 ensure_resource('file', '/etc/ssh/ssh_known_hosts', {
122 ensure => 'present', 122 ensure => 'present',
123 mode => 0644, 123 mode => '0644',
124 }) 124 })
125 125
126 # See modules/adblockplus/manifests/host.pp 126 # See modules/adblockplus/manifests/host.pp
127 create_resources('adblockplus::host', $hosts) 127 create_resources('adblockplus::host', $hosts)
128 128
129 # See modules/adblockplus/manifests/user.pp 129 # See modules/adblockplus/manifests/user.pp
130 create_resources('adblockplus::user', $users) 130 create_resources('adblockplus::user', $users)
131 } 131 }
OLDNEW
« no previous file with comments | « no previous file | modules/adblockplus/manifests/log.pp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld