Hello Everybody,
I am relatively new to Ansible and working on Student’s project with it, so please be patient.
As the subject says I would like install nagios on a remote instance. If I connect via ssh everything works just fine, but of course I would like to automate that. In general I need to translate these commands in an ansible-playbook:
cd /tmp
wget http://assets.nagios.com/downloads/nagiosxi/xi-latest.tar.gz
tar xzf xi-latest.tar.gz
cd nagiosxi
./fullinstall
This is how my playbook looks like right now. The Copy part ist just because I copy a modified “fullinstall” file without the promt for “Do you really want to install”. Everything works fine so far but the last task.
- name: Install nagios server
hosts: nagioss
become: yes
become_method: sudo
tasks:
- name: download
get_url:
url: https://assets.nagios.com/downloads/nagiosxi/xi-latest.tar.gz
dest: /tmp - name: Unzip
unarchive:
src: /tmp/xi-latest.tar.gz
dest: /tmp
remote_src: yes - name: copy modified script
copy:
src: NAGIOS/fullinstall
dest: /tmp/nagiosxi/fullinstall - name: Install
command: ./fullinstall
args:
chdir: /tmp/nagiosxi
I am receiving this error:
On the remote server is CentOS 6 installed.
Kind regards,
Jan