[ansible-project] Re: Variable not defined error

2016-12-15 Thread Alexander H. Laughlin
t or group specific vars, put them in host_vars or > group_vars this way if someone else has to read your code they do not need > to dig in the depths of roles to figure out where the vars were defined. > > Kind Regards > > On Wednesday, 14 December 2016 07:50:32 UTC, Alexander H

[ansible-project] Re: Running multiple process on the same server

2016-12-14 Thread Alexander H. Laughlin
I could be incorrect but I believe that if you write a shell script that uses fork to instantiate itself the required number of times you could just call that script using the command module. On Wednesday, December 14, 2016 at 5:13:09 AM UTC-8, Tzach Livyatan wrote: > > Hi Ansiblers > > I need t

[ansible-project] Re: Variable not defined error

2016-12-13 Thread Alexander H. Laughlin
Hello Elliott, I have written a bit of code that may be helpful to you. You may find it here: https://github.com/gahan-corporation/ansible-development/tree/master/work/elliott-barrare Hope it helps. Best of luck to you! On Monday, December 12, 2016 at 5:29:00 PM UTC-8, Elliott Barrere wro

[ansible-project] Re: set_fact array in loop

2016-12-06 Thread Alexander H. Laughlin
Given that this works just fine in the v2 release of Ansible: (vagrant) [vagrant@atrebla:vagrant] ansible --version ansible 2.2.0.0 config file = configured module search path = Default w/o overrides (vagrant) [vagrant@atrebla:vagrant] ansible-playbook loop.yml PLAY [Test set_facts for l

[ansible-project] Re: How to add something to ansible_facts?

2016-11-30 Thread Alexander H. Laughlin
You can start by providing an example playbook. On Wednesday, November 30, 2016 at 9:30:08 AM UTC-8, thok...@gmail.com wrote: > > Hi, > maybe I am being stupid here, but why doesn't it work, that when I call the > > set_fact > > module, and then run the > > setup > > module, my newly set fact is

[ansible-project] Re: Modify registered variable content from the copy module?

2016-11-30 Thread Alexander H. Laughlin
The only way I've been able to do something like this, assuming I understand correctly, is to write the value to a vars file in the playbook, then load that vars file when you need it later on in the playbook. On Wednesday, November 30, 2016 at 2:29:07 PM UTC-8, burn...@umn.edu wrote: > > Hello

Re: [ansible-project] Re: Ansible yum module unable to find certain packages

2016-11-25 Thread Alexander H. Laughlin
Indeed, it is not possible to install packages from the epel repo without first installing the repo in yum. On Thu, Nov 24, 2016 at 11:50 PM Dick Davies wrote: > Isn't that because those packages are from EPEL ? You need to add the > repo in one task, > and then add the other packages in the seco

Re: [ansible-project] Re: Ansible yum module unable to find certain packages

2016-11-23 Thread Alexander H. Laughlin
* changed: [localhost] TASK [Install base applications] *** changed: [localhost] => (item=[u'gcc', u'libsemanage-python', u 'policycoreutils-python', u'setroubleshoot', u

Re: [ansible-project] Re: Ansible yum module unable to find certain packages

2016-11-23 Thread Alexander H. Laughlin
7.3 (Maipo) > > On Tuesday, November 22, 2016 at 5:23:51 PM UTC-5, Alexander H. Laughlin > wrote: > > I'm afraid I can't reproduce this on a CentOS 7 vm running in virtualbox. > Are you using RedHat? If so, which version? > > The playbook I used for reference

[ansible-project] Re: Ansible yum module unable to find certain packages

2016-11-22 Thread Alexander H. Laughlin
I'm afraid I can't reproduce this on a CentOS 7 vm running in virtualbox. Are you using RedHat? If so, which version? The playbook I used for reference, along with the results. (duchess) [duchess@centos:jeffrey-wen] cat yum.yml --- - name: Test yum module installs. hosts: localhost b

[ansible-project] Re: vyos_config question

2016-11-21 Thread Alexander H. Laughlin
;msg": "paramiko is required but does not appear to be installed. It can > be installed using `pip install paramiko` > > I assumed it had to be run with localhost so the vyos_config parameters > would be the remote hostname/ip of the vyos machine. > > Could y

[ansible-project] Re: vyos_config question

2016-11-18 Thread Alexander H. Laughlin
- name: Configure remote device. vyos_config: lines: - set service snmp community testing authorization ro provider: "{{ cli }}" This works exactly as intended when I try it running Ansible 2.2 from a CentOS control machine to a VyOS 1.1.17 node that was i

[ansible-project] Re: Not sure why this when: is not working.

2016-11-16 Thread Alexander H. Laughlin
--- - name: Test when functionality. hosts: all tasks: - name: Output inventory_hostname. debug: msg: "The inventory hostname is {{ inventory_hostname }}." - name: Install httpd yum: name: httpd state: latest disable_gpg_check: yes

Re: [ansible-project] Re: How to clone oracle database using ansible

2016-11-06 Thread Alexander H. Laughlin
You're quite welcome, sir. I'm happy to help. On Sat, Nov 5, 2016 at 8:46 AM Shaikh Abdul wrote: > ++ > > Provided link helped me to get oracle software installation automation > steps. > > Thank you. > > Regards, > Abdul > > On Saturday, November

[ansible-project] Re: How to clone oracle database using ansible

2016-11-04 Thread Alexander H. Laughlin
Hi Abdul, It does not appear that this is officially supported at the current time. However, you may find some useful information here . Best of luck, Alex On Friday, November 4, 2016 at 10:31:49 AM

[ansible-project] Re: Tower: setup.sh fails trying to find yum on Ubuntu

2016-10-28 Thread Alexander H. Laughlin
Ubuntu requires some special attention . The answer isn't to install yum on your poor Ubuntu machine, but instead to make sure the install script i

[ansible-project] Re: Change user while executing ansible script.

2016-10-28 Thread Alexander H. Laughlin
If you store the password in a vaulted file I believe you can use su as the become method and accomplish this result. On Friday, October 28, 2016 at 12:45:24 PM UTC-7, Nitin Mathur wrote: > > Hi, > > I am trying to figure out, if the below scenario is possible and if so, > how I can achieve it.

Re: [ansible-project] Re: group_vars and ansible's patterns - suggestions please!

2016-10-26 Thread Alexander H. Laughlin
You're quite welcome. I'm happy to help. On Wed, Oct 26, 2016 at 2:14 PM Dan Rough wrote: > That's a good idea. Thanks! I hadn't thought of that. That will simplify > things in one or two locations. > > On 26 Oct 2016, at 22:01, Alexander H. Laughlin > wrote

[ansible-project] Re: group_vars and ansible's patterns - suggestions please!

2016-10-26 Thread Alexander H. Laughlin
Hi Dan, Why not store the values in a dictionary and just pull the values you need for any given server based on its key? Alex On Wednesday, October 26, 2016 at 1:39:21 PM UTC-7, Dan Rough wrote: > > Hi, > > I'd like to know how others are dealing with keeping their group_vars > files granular

[ansible-project] Re: Not able to load the credentials

2016-10-24 Thread Alexander H. Laughlin
Hello, I believe something like the below would solve your problem: --- - hosts: localhost connection: local vars: subscription_id: XX Client_id: xxx Serect_key: XX Tenent_id:

[ansible-project] Re: auto package version selection?

2016-10-24 Thread Alexander H. Laughlin
Assuming you know ahead of time or have a way of finding out during playbook execution which version is installed I don't see why it wouldn't be possible. You could create a couple of yaml dictionaries for the purpose and iterate over whichever one is appropriate using a when statement. On Mond

Re: [ansible-project] Language reference for Ansible.

2016-10-21 Thread Alexander H. Laughlin
Is there an open issue on github for expanding on this? On Wednesday, October 19, 2016 at 9:45:16 PM UTC-7, Brian Coca wrote: > > Not a complete list and it requires descriptions, but this is a start for > such a thing: > > http://docs.ansible.com/ansible/playbooks_directives.html > > >

[ansible-project] Re: task to get username/password from group_vars

2016-10-19 Thread Alexander H. Laughlin
I almost forgot. . . It's generally unsafe to store credentials in cleartext on your hard drive, so the documentation on the Ansible Vault <http://docs.ansible.com/ansible/playbooks_vault.html> may also be of some use to you. On Wednesday, October 19, 2016 at 3:42:47 PM UTC-7,

[ansible-project] Re: task to get username/password from group_vars

2016-10-19 Thread Alexander H. Laughlin
[duchess@cody:tmp] cat /etc/ansible/hosts [juniper] localhost Make sure you have localhost in the juniper group in your inventory. [duchess@cody:tmp] cat group_vars/juniper --- username: admin password: This is not a good password. ... And if you're going to use group variables you nee

[ansible-project] Re: task to get username/password from group_vars

2016-10-19 Thread Alexander H. Laughlin
[duchess@cody:tmp] cat /etc/ansible/hosts [juniper] localhost [duchess@cody:tmp] cat playbook.yml --- - name: Execute a show command on a junos device. hosts: juniper gather_facts: no connection: local tasks: - name: Define the provider. set_fact: hostin

[ansible-project] Re: Docker container using ansible

2016-10-19 Thread Alexander H. Laughlin
The relevant documentation may be found here: http://docs.ansible.com/ansible/docker_module.html Best of luck! On Wednesday, October 19, 2016 at 8:07:24 AM UTC-7, jl2...@umbc.edu wrote: > > Hi, > > I am trying to create docker containers with the help of ansible playbook. > Need help! > > Thank

[ansible-project] Re: How to read variable file each iteration of a task?

2016-10-18 Thread Alexander H. Laughlin
Have you considered conditional includes ? Along with include_vars I thi

[ansible-project] Re: How can i push locally created branch on a repository to origin via Ansible

2016-10-04 Thread Alexander H. Laughlin
I think something like the below would work to solve your problem with the variable interpolation. - name: Push git commits with local variables. hosts: localhost vars: username: git_username password: git_password tasks: - name: Set origin to include username and password

Re: [ansible-project] Run a task on host A then skip to host B, then return to host A to finish task

2016-10-04 Thread Alexander H. Laughlin
Based on the information provided I'd say delegate_to is exactly what you need. On Tuesday, October 4, 2016 at 10:06:37 AM UTC-7, Jason DeTiberus wrote: > > > > On Tue, Oct 4, 2016 at 10:20 AM, > > wrote: > >> Hi >> >> please help >> > > Without any context it is hard to say, but you may be lo

[ansible-project] Re: Info about docker containers

2016-09-28 Thread Alexander H. Laughlin
It's not necessarily practical in your situation, but have you considered mounting the drives via nfs? On Wednesday, September 28, 2016 at 9:59:55 AM UTC-7, Ionut Cadariu wrote: > > Hello, > > I have docker containers running on multiple hosts and I need to find a > way of synchronizing a list

[ansible-project] Re: Unable to reach to EC2 instance using dynamic inventory with a single region

2016-09-22 Thread Alexander H. Laughlin
g the environment variable and setting region in ec2.ini does not > help and gives the same Unreachable error. :( > > Thanks, > Nirav > > On Thursday, 22 September 2016 15:51:27 UTC+5:30, Alexander H. Laughlin > wrote: > > Hi Nirav, > > Sorry about the lack of c

[ansible-project] Re: Unable to reach to EC2 instance using dynamic inventory with a single region

2016-09-22 Thread Alexander H. Laughlin
odule_args": { > "data": null > }, > "module_name": "ping" > }, > "ping": "pong" > } > PUT /tmp/tmpQBmgof TO > /home/centos/.ansible/tmp/ansible-tmp-1474528970.94-11790883317121/ping >

[ansible-project] Re: Dependencies from private repo

2016-09-21 Thread Alexander H. Laughlin
Hi Karibou, I think what you're looking for is the Vault . You can store the url in your vault with the username and password included. That file would look like this: role-foo-url: 'git+http://username:passw...@git.example.com/ repos/role-

[ansible-project] Re: Unable to reach to EC2 instance using dynamic inventory with a single region

2016-09-21 Thread Alexander H. Laughlin
ns_exclude') > if (configRegions == 'all'): > if self.eucalyptus_host: > > self.regions.append(boto.connect_euca(host=self.eucalyptus_host). > region.name, **self.credentials) > else: > for regionInfo in e

[ansible-project] Re: Unable to reach to EC2 instance using dynamic inventory with a single region

2016-09-19 Thread Alexander H. Laughlin
Would you mind to post your ec2.ini with the credentials taken out? Also, what is the output of ec2.py when you run it alone? On Friday, September 16, 2016 at 12:15:39 AM UTC-7, Nirav Radia wrote: > > Hi all, > > I am pretty new to Ansible. I am using ec2.py to connect to my EC2 > instances and

[ansible-project] Re: ansible Error while installation

2016-09-19 Thread Alexander H. Laughlin
Hello, If you put a config file with any of the names listed below in the directories mentioned below I believe you will find your problem solved. * ANSIBLE_CONFIG (an environment variable) * ansible.cfg (in the current directory) * .ansible.cfg (in the home directory) * /etc/ansible/ansible.

Re: [ansible-project] Can't set ownership to system user

2016-09-19 Thread Alexander H. Laughlin
Also, since a version prior to 2.0 it's been possible to specify the mode using non-octal notation. That is: mode=ug+rw,o-rwx Or, in a playbook: - name: Update permissions on a file. file: dest: /path/to/file owner: user group: group mode: ug+rw,o-rwx state: file Person

[ansible-project] Re: ansible asks for sudo password but local command does not

2016-09-19 Thread Alexander H. Laughlin
Is there a reason you're not using the yum module? On Thursday, September 15, 2016 at 9:51:24 AM UTC-7, Mike Michel wrote: > > Hi, > > i am having trouble to execute a command which needs sudo on the remote > host. when i execute it directly on the host with sudo there is no ask for > password b

[ansible-project] Re: How to get and parse the output from target hosts

2016-09-14 Thread Alexander H. Laughlin
I believe something like: - name: Reboot if packages were updated command: reboot NOW when: "'Complete!' in yumoutput" would do the trick. http://docs.ansible.com/ansible/playbooks_conditionals.html#applying-when-to-roles-and-includes http://stackoverflow.com/questions/30533372/run-an-ansi