]> Frank Brehm's Git Trees - pixelpark/pp-admin-tools.git/commitdiff
Parametrizing puppet_agent_lockfile
authorFrank Brehm <frank.brehm@pixelpark.com>
Wed, 18 Dec 2024 16:35:47 +0000 (17:35 +0100)
committerFrank Brehm <frank.brehm@pixelpark.com>
Wed, 18 Dec 2024 16:35:47 +0000 (17:35 +0100)
group_vars/all/main.yaml
playbooks/disable-ldap-server.yaml
playbooks/enable-ldap-server-replication.yaml
playbooks/offline-backup-ldap-server.yaml

index b1f11d498f2863aae9b4fc5b5eddd95a915f2050..91e7bdcba05e9c18d099a3921147d96935dd5741 100644 (file)
@@ -6,4 +6,6 @@
 # ds389_plugin_attr_uniq_config: true
 # ds389_plugin_account_policy_config: true
 
+puppet_agent_lockfile: '/opt/puppetlabs/puppet/cache/state/agent_disabled.lock'
+
 # vim: filetype=yaml
index 459101d4fe5bd36c5ddc7f84eab5264e5d27ecf0..7b37be875fef2b6667de690b5541dd60c1050f74 100644 (file)
           ansible.builtin.shell: |
             puppet agent --disable "[$( date +'%Y-%m-%d' )]: Disabled by Ansible playbook 'disable-ldap-server.yaml'."
           args:
-            creates: '/opt/puppetlabs/puppet/cache/state/agent_disabled.lock'
+            creates: "{{ puppet_agent_lockfile }}"
 
         - name: "Disabling Puppet service on {{ ldapserver_to_disable | quote  }}."
           ansible.builtin.service:
index 108aaafc42fec19e0a38677b9ac19fcc8375245b..9a218634a86ee8ff69dd2e503f9f0b6fd0b2b117 100644 (file)
           ansible.builtin.shell: |
             puppet agent --enable
           args:
-            removes: '/opt/puppetlabs/puppet/cache/state/agent_disabled.lock'
+            removes: "{{ puppet_agent_lockfile }}"
 
 # vim: filetype=yaml
index acfc6bb153065d47566adcd406c8632ee72d8536..c775a8bd4cffa8ea7dac660443ded59319809692 100644 (file)
@@ -72,7 +72,7 @@
 
         - name: "Get active status of Puppet lockfile."
           ansible.builtin.stat:
-            path: '/opt/puppetlabs/puppet/cache/state/agent_disabled.lock'
+            path: "{{ puppet_agent_lockfile }}"
           register: stat_puppet_lockfile
 
         - name: "File stat of Puppet Puppet lockfile."
@@ -93,7 +93,7 @@
           ansible.builtin.shell: |
             puppet agent --disable "[{{ cur_timestamp }}]: Disabled by Ansible playbook 'disable-ldap-server.yaml'."
           args:
-            creates: '/opt/puppetlabs/puppet/cache/state/agent_disabled.lock'
+            creates: "{{ puppet_agent_lockfile }}"
 
         - name: "Get status of Wazuh service."
           ansible.builtin.systemd:
         - name: "Enabling Puppet agent."
           ansible.builtin.shell: puppet agent --enable
           args:
-            removes: '/opt/puppetlabs/puppet/cache/state/agent_disabled.lock'
+            removes: "{{ puppet_agent_lockfile }}"
           when: puppet_already_locked != true