Ebin Davis
Ebin Davis

Reputation: 6139

How can i set password to nagios using ansible playbook

I want to set the password for nagios core using ansible playbook. Manually doing , command to set the password is :

sudo htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin

New password:

Re-type new password:

I want to set the same through ansible playbook.

Upvotes: 1

Views: 306

Answers (1)

Arbab Nazar
Arbab Nazar

Reputation: 23811

Did you try the htpasswd module like this:

- name: Set password to nagios
  htpasswd:
    path: "/usr/local/nagios/etc/htpasswd.users"
    name: nagiosadmin
    password: "Very-Secure-Password"
    crypt_scheme: md5_crypt

Note: passlib must be install on host that executes module

Upvotes: 4

Related Questions