Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pdksync - remove legacy anchor resources #11

Merged
merged 2 commits into from
Feb 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 1 addition & 15 deletions manifests/instance.pp
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,6 @@
server_host => $server_host,
server_port => $server_port,
require => Service["dirsrv@${server_id}"],
before => Anchor["${name}_ldif_modify"],
}
}
}
Expand Down Expand Up @@ -552,7 +551,6 @@
user => $user,
group => $group,
require => Service["dirsrv@${server_id}"],
before => Anchor["${name}_ldif_modify"],
}
}

Expand All @@ -577,10 +575,6 @@
}
}

anchor { "${name}_ldif_modify":
require => Service["dirsrv@${server_id}"],
}

# ldif modify
if $modify_ldifs {
$modify_ldifs.each |$filename, $source| {
Expand All @@ -595,14 +589,11 @@
user => $user,
group => $group,
tag => "${server_id}_modify",
require => Anchor["${name}_ldif_modify"],
before => Anchor["${name}_ldif_add"],
require => Service["dirsrv@${server_id}"],
}
}
}

anchor { "${name}_ldif_add": }

# ldif add
if $add_ldifs {
$add_ldifs.each |$filename, $source| {
Expand All @@ -617,14 +608,10 @@
user => $user,
group => $group,
tag => "${server_id}_add",
require => Anchor["${name}_ldif_add"],
before => Anchor["${name}_ldif_base_load"],
}
}
}

anchor { "${name}_ldif_base_load": }

# ldif base_load
if $base_load_ldifs {
$base_load_ldifs.each |$filename, $source| {
Expand All @@ -639,7 +626,6 @@
user => $user,
group => $group,
tag => "${server_id}_base_load",
require => Anchor["${name}_ldif_base_load"],
}
}
}
Expand Down
15 changes: 2 additions & 13 deletions manifests/replication.pp
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@
path => $ds_389::path,
creates => $repl_init_done,
require => [
Anchor["${name}_replication_suppliers"],
Exec["Add replication user: ${name}"],
Exec["Create replication agreement for hub ${replica}: ${name}"],
],
}
Expand All @@ -415,7 +415,6 @@
path => $ds_389::path,
creates => $repl_enable_done,
require => [
Anchor["${name}_replication_hubs"],
Exec["Add replication user: ${name}"],
],
}
Expand All @@ -439,7 +438,7 @@
path => $ds_389::path,
creates => $repl_init_done,
require => [
Anchor["${name}_replication_consumers"],
Exec["Add replication user: ${name}"],
Exec["Create replication agreement for consumer ${replica}: ${name}"],
],
}
Expand Down Expand Up @@ -470,14 +469,4 @@
Ds_389::Ssl[$name],
],
}

anchor { "${name}_replication_suppliers":
require => Exec["Add replication user: ${name}"],
}
anchor { "${name}_replication_hubs":
require => Anchor["${name}_replication_suppliers"],
}
anchor { "${name}_replication_consumers":
require => Anchor["${name}_replication_hubs"],
}
}
3 changes: 0 additions & 3 deletions spec/classes/ds389_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -255,9 +255,6 @@
it { is_expected.to contain_file('/etc/init.d/dirsrv@foo') }
end
it { is_expected.to contain_service('dirsrv@foo') }
it { is_expected.to contain_anchor('foo_ldif_modify').that_requires('Service[dirsrv@foo]') }
it { is_expected.to contain_anchor('foo_ldif_add') }
it { is_expected.to contain_anchor('foo_ldif_base_load') }
end
end
end
Expand Down
1 change: 1 addition & 0 deletions spec/default_facts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ networking:
ip: "172.16.254.254"
ip6: "FE80:0000:0000:0000:AAAA:AAAA:AAAA"
mac: "AA:AA:AA:AA:AA:AA"
fqdn: "foo.example.com"
is_pe: false
19 changes: 6 additions & 13 deletions spec/defines/instance_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1046,9 +1046,6 @@

it { is_expected.to contain_exec('Add replication user: ldap01') }
it { is_expected.to contain_file('/etc/dirsrv/slapd-ldap01/replication-user.ldif') }
it { is_expected.to contain_anchor('ldap01_replication_suppliers').that_requires('Exec[Add replication user: ldap01]') }
it { is_expected.to contain_anchor('ldap01_replication_hubs').that_requires('Anchor[ldap01_replication_suppliers]') }
it { is_expected.to contain_anchor('ldap01_replication_consumers').that_requires('Anchor[ldap01_replication_hubs]') }
end

context 'when loading additional ldifs' do
Expand Down Expand Up @@ -1083,10 +1080,6 @@

it { is_expected.to compile }

it { is_expected.to contain_anchor('specdirectory_ldif_modify').that_requires('Service[dirsrv@ldap01]') }
it { is_expected.to contain_anchor('specdirectory_ldif_add') }
it { is_expected.to contain_anchor('specdirectory_ldif_base_load') }

it {
is_expected.to contain_ds_389__modify('specmodify1').with(
server_id: 'ldap01',
Expand All @@ -1098,7 +1091,7 @@
source: 'puppet:///specfiles/specmodify1.ldif',
user: 'custom_user',
group: 'custom_group',
).that_requires('Anchor[specdirectory_ldif_modify]').that_comes_before('Anchor[specdirectory_ldif_add]')
)
}
it { is_expected.to contain_file('/etc/dirsrv/slapd-ldap01/specmodify1.ldif') }
it { is_expected.to contain_exec('Modify ldif specmodify1: ldap01') }
Expand All @@ -1113,7 +1106,7 @@
source: 'puppet:///specfiles/specmodify2.ldif',
user: 'custom_user',
group: 'custom_group',
).that_requires('Anchor[specdirectory_ldif_modify]').that_comes_before('Anchor[specdirectory_ldif_add]')
)
}
it { is_expected.to contain_file('/etc/dirsrv/slapd-ldap01/specmodify2.ldif') }
it { is_expected.to contain_exec('Modify ldif specmodify2: ldap01') }
Expand All @@ -1129,7 +1122,7 @@
source: 'puppet:///specfiles/specadd1.ldif',
user: 'custom_user',
group: 'custom_group',
).that_requires('Anchor[specdirectory_ldif_add]').that_comes_before('Anchor[specdirectory_ldif_base_load]')
)
}
it { is_expected.to contain_file('/etc/dirsrv/slapd-ldap01/specadd1.ldif') }
it { is_expected.to contain_exec('Add ldif specadd1: ldap01') }
Expand All @@ -1144,7 +1137,7 @@
source: 'puppet:///specfiles/specadd2.ldif',
user: 'custom_user',
group: 'custom_group',
).that_requires('Anchor[specdirectory_ldif_add]').that_comes_before('Anchor[specdirectory_ldif_base_load]')
)
}
it { is_expected.to contain_file('/etc/dirsrv/slapd-ldap01/specadd2.ldif') }
it { is_expected.to contain_exec('Add ldif specadd2: ldap01') }
Expand All @@ -1160,7 +1153,7 @@
source: 'puppet:///specfiles/specbaseload1.ldif',
user: 'custom_user',
group: 'custom_group',
).that_requires('Anchor[specdirectory_ldif_base_load]')
)
}
it { is_expected.to contain_file('/etc/dirsrv/slapd-ldap01/specbaseload1.ldif') }
it { is_expected.to contain_exec('Add ldif specbaseload1: ldap01') }
Expand All @@ -1175,7 +1168,7 @@
source: 'puppet:///specfiles/specbaseload2.ldif',
user: 'custom_user',
group: 'custom_group',
).that_requires('Anchor[specdirectory_ldif_base_load]')
)
}
it { is_expected.to contain_file('/etc/dirsrv/slapd-ldap01/specbaseload2.ldif') }
it { is_expected.to contain_exec('Add ldif specbaseload2: ldap01') }
Expand Down
8 changes: 4 additions & 4 deletions spec/defines/replication_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -278,10 +278,6 @@
creates: '/etc/dirsrv/slapd-specdirectory/replication-user.done',
).that_requires('File[/etc/dirsrv/slapd-specdirectory/replication-user.ldif]')
}

it { is_expected.to contain_anchor('specdirectory_replication_suppliers').that_requires('Exec[Add replication user: specdirectory]') }
it { is_expected.to contain_anchor('specdirectory_replication_hubs').that_requires('Anchor[specdirectory_replication_suppliers]') }
it { is_expected.to contain_anchor('specdirectory_replication_consumers').that_requires('Anchor[specdirectory_replication_hubs]') }
end

context 'with parameter overrides' do
Expand Down Expand Up @@ -706,6 +702,7 @@
creates: '/etc/dirsrv/slapd-specdirectory/hub_hub1_init.done',
).that_requires(
[
'Exec[Add replication user: specdirectory]',
'Exec[Create replication agreement for hub hub1: specdirectory]',
],
)
Expand Down Expand Up @@ -742,6 +739,7 @@
creates: '/etc/dirsrv/slapd-specdirectory/consumer_consumer1_init.done',
).that_requires(
[
'Exec[Add replication user: specdirectory]',
'Exec[Create replication agreement for consumer consumer1: specdirectory]',
],
)
Expand Down Expand Up @@ -951,6 +949,7 @@
creates: '/etc/dirsrv/slapd-specdirectory/hub_hub1_init.done',
).that_requires(
[
'Exec[Add replication user: specdirectory]',
'Exec[Create replication agreement for hub hub1: specdirectory]',
],
)
Expand Down Expand Up @@ -993,6 +992,7 @@
creates: '/etc/dirsrv/slapd-specdirectory/consumer_consumer1_init.done',
).that_requires(
[
'Exec[Add replication user: specdirectory]',
'Exec[Create replication agreement for consumer consumer1: specdirectory]',
],
)
Expand Down
Loading