Skip to content

Commit c55e7a7

Browse files
authored
Merge pull request #1532 from puppetlabs/CONT-359-Syntax_update
(CONT-359) Syntax update
2 parents 18012b9 + 6a62778 commit c55e7a7

24 files changed

+350
-326
lines changed

.puppet-lint.rc

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
11
--relative
2-
--no-parameter_types-check
3-
--no-parameter_documentation-check
4-
--no-legacy_facts-check
5-
--no-top_scope_facts-check
62
--no-anchor_resource-check
7-
--no-relative_classname_reference-check
83
--no-params_empty_string_assignment-check

.sync.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,5 @@ Rakefile:
3636
changelog_since_tag: 'v11.0.3'
3737
Rakefile:
3838
extra_disabled_lint_checks:
39-
- parameter_types
40-
- parameter_documentation
41-
- legacy_facts
42-
- top_scope_facts
4339
- anchor_resource
44-
- relative_classname_reference
4540
- params_empty_string_assignment

Rakefile

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,7 @@ def changelog_future_release
4242
end
4343

4444
PuppetLint.configuration.send('disable_relative')
45-
PuppetLint.configuration.send('disable_parameter_types')
46-
PuppetLint.configuration.send('disable_parameter_documentation')
47-
PuppetLint.configuration.send('disable_legacy_facts')
48-
PuppetLint.configuration.send('disable_top_scope_facts')
4945
PuppetLint.configuration.send('disable_anchor_resource')
50-
PuppetLint.configuration.send('disable_relative_classname_reference')
5146
PuppetLint.configuration.send('disable_params_empty_string_assignment')
5247

5348

examples/monitor.pp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
$mysql_monitor_password = 'password'
55
$mysql_monitor_username = 'monitoring'
6-
$mysql_monitor_hostname = $::facts['networking']['hostname']
6+
$mysql_monitor_hostname = $facts['networking']['hostname']
77

88
mysql_user { "${mysql_monitor_username}@${mysql_monitor_hostname}":
99
ensure => present,

examples/mysql_db.pp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@
77
host => 'localhost',
88
grant => ['SELECT', 'UPDATE'],
99
}
10-
mysql::db { "mydb_${fqdn}":
10+
mysql::db { "mydb_${facts['networking']['fqdn']}":
1111
user => 'myuser',
1212
password => 'mypass',
1313
dbname => 'mydb',
14-
host => $::fqdn,
14+
host => $facts['networking']['fqdn'],
1515
grant => ['SELECT', 'UPDATE'],
1616
tag => $domain,
1717
}

examples/mysql_login_path.pp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
include apt
33
apt::source { 'repo.mysql.com':
44
location => 'http://repo.mysql.com/apt/debian',
5-
release => $::lsbdistcodename,
5+
release => $facts['os']['distro']['codename'],
66
repos => 'mysql-8.0',
77
key => {
88
id => 'A4A9406876FCBD3C456770C88C718D3B5072E1F5',
@@ -35,7 +35,7 @@
3535
class { 'mysql::client':
3636
package_manage => false,
3737
package_name => 'mysql-community-client',
38-
require => Class['::mysql::server'],
38+
require => Class['mysql::server'],
3939
}
4040

4141
mysql_login_path { 'client':
@@ -54,7 +54,7 @@
5454
password => Sensitive('blah'),
5555
port => 3306,
5656
owner => root,
57-
require => Class['::mysql::server'],
57+
require => Class['mysql::server'],
5858
}
5959

6060
mysql_user { 'dan@localhost':

examples/mysql_plugin.pp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
root_password => 'password',
33
}
44

5-
$validate_password_soname = $::osfamily ? {
5+
$validate_password_soname = $facts['os']['family'] ? {
66
'windows' => 'validate_password.dll',
77
default => 'validate_password.so'
88
}
@@ -12,7 +12,7 @@
1212
soname => $validate_password_soname,
1313
}
1414

15-
$auth_socket_soname = $::osfamily ? {
15+
$auth_socket_soname = $facts['os']['family'] ? {
1616
'windows' => 'auth_socket.dll',
1717
default => 'auth_socket.so'
1818
}

manifests/backup/mysqlbackup.pp

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -4,34 +4,34 @@
44
# @api private
55
#
66
class mysql::backup::mysqlbackup (
7-
$backupuser = '',
8-
Variant[String, Sensitive[String]] $backuppassword = '',
9-
$maxallowedpacket = '1M',
10-
$backupdir = '',
11-
$backupdirmode = '0700',
12-
$backupdirowner = 'root',
13-
$backupdirgroup = $mysql::params::root_group,
14-
$backupcompress = true,
15-
$backuprotate = 30,
16-
$backupmethod = '',
17-
$backup_success_file_path = undef,
18-
$ignore_events = true,
19-
$delete_before_dump = false,
20-
$backupdatabases = [],
21-
$file_per_database = false,
22-
$include_triggers = true,
23-
$include_routines = false,
24-
$ensure = 'present',
25-
$time = ['23', '5'],
26-
$prescript = false,
27-
$postscript = false,
28-
$execpath = '/usr/bin:/usr/sbin:/bin:/sbin',
29-
$optional_args = [],
30-
$incremental_backups = false,
31-
$install_cron = true,
32-
$compression_command = undef,
33-
$compression_extension = undef,
34-
$backupmethod_package = undef,
7+
String $backupuser = '',
8+
Variant[String, Sensitive[String]] $backuppassword = '',
9+
String[1] $maxallowedpacket = '1M',
10+
String $backupdir = '',
11+
String[1] $backupdirmode = '0700',
12+
String[1] $backupdirowner = 'root',
13+
String[1] $backupdirgroup = $mysql::params::root_group,
14+
Boolean $backupcompress = true,
15+
Variant[Integer, String[1]] $backuprotate = 30,
16+
String $backupmethod = '',
17+
Optional[String[1]] $backup_success_file_path = undef,
18+
Boolean $ignore_events = true,
19+
Boolean $delete_before_dump = false,
20+
Array[String[1]] $backupdatabases = [],
21+
Boolean $file_per_database = false,
22+
Boolean $include_triggers = true,
23+
Boolean $include_routines = false,
24+
Enum['present', 'absent'] $ensure = 'present',
25+
Variant[Array[String[1]], Array[Integer]] $time = ['23', '5'],
26+
Variant[Boolean, String[1], Array[String[1]]] $prescript = false,
27+
Variant[Boolean, String[1], Array[String[1]]] $postscript = false,
28+
String[1] $execpath = '/usr/bin:/usr/sbin:/bin:/sbin',
29+
Array[String[1]] $optional_args = [],
30+
Boolean $incremental_backups = false,
31+
Boolean $install_cron = true,
32+
Optional[String[1]] $compression_command = undef,
33+
Optional[String[1]] $compression_extension = undef,
34+
Optional[String[1]] $backupmethod_package = undef,
3535
) inherits mysql::params {
3636
$backuppassword_unsensitive = if $backuppassword =~ Sensitive {
3737
$backuppassword.unwrap
@@ -74,9 +74,9 @@
7474
}
7575

7676
if $install_cron {
77-
if $::osfamily == 'RedHat' {
77+
if $facts['os']['family'] == 'RedHat' {
7878
ensure_packages('cronie')
79-
} elsif $::osfamily != 'FreeBSD' {
79+
} elsif $facts['os']['family'] != 'FreeBSD' {
8080
ensure_packages('cron')
8181
}
8282
}

manifests/backup/mysqldump.pp

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -3,45 +3,45 @@
33
# @api private
44
#
55
class mysql::backup::mysqldump (
6-
$backupuser = '',
7-
Variant[String, Sensitive[String]] $backuppassword = '',
8-
$backupdir = '',
9-
$maxallowedpacket = '1M',
10-
$backupdirmode = '0700',
11-
$backupdirowner = 'root',
12-
$backupdirgroup = $mysql::params::root_group,
13-
$backupcompress = true,
14-
$backuprotate = 30,
15-
$backupmethod = 'mysqldump',
16-
$backup_success_file_path = undef,
17-
$ignore_events = true,
18-
$delete_before_dump = false,
19-
$backupdatabases = [],
20-
$file_per_database = false,
21-
$include_triggers = false,
22-
$include_routines = false,
23-
$ensure = 'present',
24-
$time = ['23', '5'],
25-
$prescript = false,
26-
$postscript = false,
27-
$execpath = '/usr/bin:/usr/sbin:/bin:/sbin',
28-
$optional_args = [],
29-
$mysqlbackupdir_ensure = 'directory',
30-
$mysqlbackupdir_target = undef,
31-
$incremental_backups = false,
32-
$install_cron = true,
33-
$compression_command = 'bzcat -zc',
34-
$compression_extension = '.bz2',
35-
$backupmethod_package = undef,
36-
Array[String] $excludedatabases = [],
6+
String $backupuser = '',
7+
Variant[String, Sensitive[String]] $backuppassword = '',
8+
String $backupdir = '',
9+
String[1] $maxallowedpacket = '1M',
10+
String[1] $backupdirmode = '0700',
11+
String[1] $backupdirowner = 'root',
12+
String[1] $backupdirgroup = $mysql::params::root_group,
13+
Boolean $backupcompress = true,
14+
Variant[Integer, String[1]] $backuprotate = 30,
15+
String[1] $backupmethod = 'mysqldump',
16+
Optional[String[1]] $backup_success_file_path = undef,
17+
Boolean $ignore_events = true,
18+
Boolean $delete_before_dump = false,
19+
Array[String[1]] $backupdatabases = [],
20+
Boolean $file_per_database = false,
21+
Boolean $include_triggers = false,
22+
Boolean $include_routines = false,
23+
Enum['present', 'absent'] $ensure = 'present',
24+
Variant[Array[String[1]], Array[Integer]] $time = ['23', '5'],
25+
Variant[Boolean, String[1], Array[String[1]]] $prescript = false,
26+
Variant[Boolean, String[1], Array[String[1]]] $postscript = false,
27+
String[1] $execpath = '/usr/bin:/usr/sbin:/bin:/sbin',
28+
Array[String[1]] $optional_args = [],
29+
String[1] $mysqlbackupdir_ensure = 'directory',
30+
Optional[String[1]] $mysqlbackupdir_target = undef,
31+
Boolean $incremental_backups = false,
32+
Boolean $install_cron = true,
33+
String[1] $compression_command = 'bzcat -zc',
34+
String[1] $compression_extension = '.bz2',
35+
Optional[String[1]] $backupmethod_package = undef,
36+
Array[String] $excludedatabases = [],
3737
) inherits mysql::params {
3838
$backuppassword_unsensitive = if $backuppassword =~ Sensitive {
3939
$backuppassword.unwrap
4040
} else {
4141
$backuppassword
4242
}
4343

44-
unless $::osfamily == 'FreeBSD' {
44+
unless $facts['os']['family'] == 'FreeBSD' {
4545
if $backupcompress and $compression_command == 'bzcat -zc' {
4646
ensure_packages(['bzip2'])
4747
Package['bzip2'] -> File['mysqlbackup.sh']
@@ -69,9 +69,9 @@
6969
}
7070

7171
if $install_cron {
72-
if $::osfamily == 'RedHat' {
72+
if $facts['os']['family'] == 'RedHat' {
7373
ensure_packages('cronie')
74-
} elsif $::osfamily != 'FreeBSD' {
74+
} elsif $facts['os']['family'] != 'FreeBSD' {
7575
ensure_packages('cron')
7676
}
7777
}

manifests/backup/xtrabackup.pp

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -3,37 +3,37 @@
33
# @api private
44
#
55
class mysql::backup::xtrabackup (
6-
$backupuser = undef,
7-
Optional[Variant[String, Sensitive[String]]] $backuppassword = undef,
8-
$backupdir = '',
9-
$maxallowedpacket = '1M',
10-
$backupmethod = 'xtrabackup',
11-
$backupdirmode = '0700',
12-
$backupdirowner = 'root',
13-
$backupdirgroup = $mysql::params::root_group,
14-
$backupcompress = true,
15-
$backuprotate = 30,
16-
$backupscript_template = 'mysql/xtrabackup.sh.erb',
17-
$backup_success_file_path = undef,
18-
$ignore_events = true,
19-
$delete_before_dump = false,
20-
$backupdatabases = [],
21-
$file_per_database = false,
22-
$include_triggers = true,
23-
$include_routines = false,
24-
$ensure = 'present',
25-
$time = ['23', '5'],
26-
$prescript = false,
27-
$postscript = false,
28-
$execpath = '/usr/bin:/usr/sbin:/bin:/sbin',
29-
$optional_args = [],
30-
$additional_cron_args = '--backup',
31-
$incremental_backups = true,
32-
$install_cron = true,
33-
$compression_command = undef,
34-
$compression_extension = undef,
35-
$backupmethod_package = $mysql::params::xtrabackup_package_name,
36-
Array[String] $excludedatabases = [],
6+
Optional[String] $backupuser = undef,
7+
Optional[Variant[String, Sensitive[String]]] $backuppassword = undef,
8+
String $backupdir = '',
9+
String[1] $maxallowedpacket = '1M',
10+
String[1] $backupmethod = 'xtrabackup',
11+
String[1] $backupdirmode = '0700',
12+
String[1] $backupdirowner = 'root',
13+
String[1] $backupdirgroup = $mysql::params::root_group,
14+
Boolean $backupcompress = true,
15+
Variant[Integer, String[1]] $backuprotate = 30,
16+
String[1] $backupscript_template = 'mysql/xtrabackup.sh.erb',
17+
Optional[String[1]] $backup_success_file_path = undef,
18+
Boolean $ignore_events = true,
19+
Boolean $delete_before_dump = false,
20+
Array[String[1]] $backupdatabases = [],
21+
Boolean $file_per_database = false,
22+
Boolean $include_triggers = true,
23+
Boolean $include_routines = false,
24+
Enum['present', 'absent'] $ensure = 'present',
25+
Variant[Array[String[1]], Array[Integer]] $time = ['23', '5'],
26+
Variant[Boolean, String[1], Array[String[1]]] $prescript = false,
27+
Variant[Boolean, String[1], Array[String[1]]] $postscript = false,
28+
String[1] $execpath = '/usr/bin:/usr/sbin:/bin:/sbin',
29+
Array[String[1]] $optional_args = [],
30+
String[1] $additional_cron_args = '--backup',
31+
Boolean $incremental_backups = true,
32+
Boolean $install_cron = true,
33+
Optional[String[1]] $compression_command = undef,
34+
Optional[String[1]] $compression_extension = undef,
35+
String[1] $backupmethod_package = $mysql::params::xtrabackup_package_name,
36+
Array[String] $excludedatabases = [],
3737
) inherits mysql::params {
3838
ensure_packages($backupmethod_package)
3939

@@ -109,9 +109,9 @@
109109
}
110110

111111
if $install_cron {
112-
if $::osfamily == 'RedHat' {
112+
if $facts['os']['family'] == 'RedHat' {
113113
ensure_packages('cronie')
114-
} elsif $::osfamily != 'FreeBSD' {
114+
} elsif $facts['os']['family'] != 'FreeBSD' {
115115
ensure_packages('cron')
116116
}
117117
}
@@ -138,7 +138,7 @@
138138
}
139139

140140
# Wether to use GNU or BSD date format.
141-
case $::osfamily {
141+
case $facts['os']['family'] {
142142
'FreeBSD','OpenBSD': {
143143
$dateformat = '$(date -v-sun +\\%F)_full'
144144
}

0 commit comments

Comments
 (0)