ansible nagios with htpasswd authentication

[root@openstack ~]# cat nagios.yml
- hosts: all
  user: root
  become: yes
# the way to use privilege
  become_method: sudo
  tasks:
    - name: install epel-release

      yum: name=epel-release  state=installed
    - name: install nagios, nrpe, nagios-plugins-all
      yum: name={{item}} state=installed
      with_items:
      - epel-release
      - nagios
      - nrpe
      - nagios-plugins-all
      - openssl

    - name: nagios is installed
      yum:
        name=nagios
        state=installed
    - name: nagios is running and enabled
      service:
        name=nagios
        state=started
        enabled=yes
    - name: Set password to nagios
      htpasswd:
        path: "/usr/local/nagios/etc/htpasswd.users"
        name: nagiosadmin
        password: "nagios"
        crypt_scheme: md5_crypt
[root@openstack ~]#

Comments

Popular posts from this blog

ansible redhat cluster qorum qdevice

PE 3.9.0 on centos 6

gfs2 cluster