- name: installing dependencies
yum:
name: "{{ item }}"
state: present
with_items:
- gcc
- glibc
- glibc-common
- gd
- gd-devel
- make
- net-snmp
- libselinux-python
- name: adding group
group:
name: nagcmd
state: present
- name: adding user
user:
name: nagios
state: present
group: nagcmd
- name: downloading nagios plugin
unarchive:
src: "{{ item }}"
dest: /tmp
remote_src: yes
with_items:
- http://github.com/NagiosEnterprises/nagioscore/releases/download/nagios-4.2.0/nagios-4.2.0.tar.gz
- https://www.nagios-plugins.org/download/nagios-plugins-2.1.2.tar.gz
- name: changing directory and installing nagios
command: '"{{ item }}" chdir /tmp/nagios-4.2.0'
with_items:
- ./configure --with-command-group=nagcmd
- name: changing directory and installing nagios
command: '"{{ item }}" chdir /tmp/nagios-4.2.0'
with_items:
- make all
- name: changing directory and installing nagios
command: '"{{ item }}" chdir /tmp/nagios-4.2.0'
with_items:
- make install
While ruuning this playbook iam getting the following error.
TASK [nagios : changing directory and installing nagios] ***********************
failed: [52.172.55.94] (item=./configure --with-command-group=nagcmd) => {"changed": false, "cmd": "'./configure --with-command-group=nagcmd' chdir /tmp/nagios-4.2.0", "failed": true, "item": "./configure --with-command-group=nagcmd", "msg": "[Errno 2] No such file or directory", "rc": 2}
How to run ./compile make and make install commands using ansible?Pls help.