# 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
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:
- 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."
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