On 13. juni 2016 19:33, Thomas Steele wrote:
I'm trying to get a playbook that will download, untar, configure and make
nagios client on a rhel7 server. So far the download and untar are working
perfectly, but the configure and make commands are not running properly.
Going to the server itself and running ./configure and make works
perfectly. Any help is greatly appreciated.


Use chdir


- name: configure nagios
>   command: /tmp/download/nagios-plugins-2.0.3/configure

- name: configure nagios
  command: ./configure
  args:
    chdir: /tmp/download/nagios-plugins-2.0.3


- name: make files
>   command: /tmp/download/nagios-plugins-2.0.3 make;make install

The semicolon is a shell operation, command doesn't support that. You will have to use shell, split it in two or use with_items.

And maybe something like this will work:
- name: configure, make and make install nagios
  command: "{{ item }}"
  args:
    chdir: /tmp/download/nagios-plugins-2.0.3
  with_items:
    - ./configure
    - make
    - make install

--
Kai Stian Olstad

--
You received this message because you are subscribed to the Google Groups "Ansible 
Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/575EF5AE.2060509%40olstad.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to