Technotes

Technotes for future me

Ansible service handlers

    # RHEL 6 and 7 Set correct permissions
    - name: RHEL 6 and 7 Set correct permissions
      file:
        path: /etc/nslcd.conf
        mode: '0600'
      notify: restart nslcd
      when: (ansible_facts['distribution_major_version'] == "6") or (ansible_facts['distribution_major_version'] == "7")

  # Restart handlers
  handlers:
    - name: restart nscd
      service:
        name: nscd
        state: restarted
    - name: restart nslcd
      service:
        name: nslcd
        state: restarted
Last updated on 31 Jan 2021
Published on 16 Dec 2019
Edit on GitHub