On 12.10.2017 02:09, Iyyappan V wrote:
Hi All,
I am new to Ansible and in learning phase. have a query like how to
install
a custom software package (hyperic agent) using ansible..
i need to install a software around 3000 servers in one shot from
ansible
server
I have two things to do,
1. copy package to the server
2. untar the package
3. install the package
Generally that software can be installed manually like below
#/home/hyperic/hyperic-agent/bin/script.sh start
Will the below playbook work? Unfortunately I am not in a network to
connect and test it out by myself.
You have a lot of indentation error in you code, I suggest reading
http://docs.ansible.com/ansible/latest/YAMLSyntax.html and
http://docs.ansible.com/ansible/latest/playbooks.html
Pay attention to indentation, it must be space and you need to be
consistent of how many spaces.
To check the syntax you don't need a network to test, ansible-playbook
has option --syntax-check.
So run you code and fix everything "ansible-playbook --syntax-check
your.yml" complains about, you only need ansible installed to do this.
Since you have so many indentation errors in you code I'm not going to
address them in comment below, only the functionality.
======
- hosts: all
remote_user: hyperic
become_user: root
become_method: su
tasks:
# Copy remote file (host.example.com:/tmp/hyperic_agent.tar) into
# /home/hyperic/hyperic_agent.tar on local machine
-fetch:
src: /tmp/hyperic_agent.tar
dst: /home/hyperic
Fetch module copies/fetch the file from remote host to the Ansible
controller.
So your choices are fetch against host.example.com with a delegate_to
and then do a copy to remote host, use the get_url or the synchronize
module.
-name: Extract hyperic_agent.tar into /home/hyperic
unarchive:
src:/home/hyperic/hyperic_agent.tar
dst:/home/hyperic/
remote_src: yes
- name: Install Hyperic
package: name='hyperic_agent" state=started
package will install software from the repository, you will need to use
the command module to run the script as you would when installing it
manually.
--
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/dd8dd35279f0ceaec0b8d2f84e1c8fee%40olstad.com.
For more options, visit https://groups.google.com/d/optout.