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 ~]#
- 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
Post a Comment