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

2016-11-22 Thread 'Jeffrey Wen' via Ansible Project
I am using Red Hat Enterprise Linux Server release 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

[ansible-project] skipped role, register and with_items causing headaches

2016-11-22 Thread Paul Baker
Hi All, It seems like issues along these lines have been raised as bugs and closed several times... see https://github.com/ansible/ansible/issues/17500 I have created a role, which I intend to skip under certain circumstances. When the role is skipped, all tasks still run... OK... I don't

Re: [ansible-project] How to find network device by macaddress ?

2016-11-22 Thread Don Jackson
This worked great, thank you! For the record, here is the current version of my test playbook: - hosts: foo.example.com vars: target_macaddr: "0c:c4:7a:17:9a:94" tasks: - debug: var: hostvars[inventory_hostname]['ansible_' + item].device when:

Re: [ansible-project] How to deal with "inventory" that isn't inventoriable.

2016-11-22 Thread Spike
Stephen, if I understood your question/situation, I've dealt with the same issue in the past and my conclusion is that ansible's inventory (or in general the inventory of any automation system) isn't the right solution. What you're looking for is a CMDB or in other words an inventory/asset

[ansible-project] How to deal with "inventory" that isn't inventoriable.

2016-11-22 Thread Stephen John Smoogen
I have a large number of out of band hardware (IBM IMM, routers owned by other groups, Dracs (which will be ansibled soon), and similar odd things) which I need to keep track of for various other software like nagios and maybe DNS configs. Since I keep all the other hosts in the ansible inventory

Re: [ansible-project] Get a list of --limit servers

2016-11-22 Thread bmccarthy
'play_hosts' doesn't work because the 'icinga2-ansible-add-hosts' role is only applied to "{{ hosts | default('monitoring_servers') }}" What I'm trying to get is the list of hosts that - hosts: all gather_facts: yes runs against, which is not all of the hosts in my inventory. On Tuesday,

[ansible-project] Re: ecs_taskdefinition module not creating new revision

2016-11-22 Thread Brian Jackson
If nothing has changed on the second run then it's behaving correctly. I'm have a related problem (which lead me to this thread) where I do change the definition in the playbook but Ansible doesn't create a new revision. In my case I'm updating the tag in the image. In your example I'd be

Re: [ansible-project] Get a list of --limit servers

2016-11-22 Thread Brian Coca
​try the 'play_hosts' variable.​ -- Brian Coca -- 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 ansible-project+unsubscr...@googlegroups.com. To

[ansible-project] Get a list of --limit servers

2016-11-22 Thread bmccarthy
I'm using the icinga2-ansible-add-hosts role, which creates config files for each host. My playbook starts like this: --- - hosts: all gather_facts: True - hosts: "{{ hosts | default('monitoring_servers') }}" - strategy: debug - role: icinga2-ansible-add-hosts Inside the

[ansible-project] Re: Failed to install ansible on Ubuntu 14

2016-11-22 Thread Trond Hindenes
this is how I install Ansible, worked on ubuntu 14.04 last time I checked. See if you're missing a package? https://gist.github.com/trondhindenes/01cbcd3e3a98ff57fc00cc5fde97545a On Tuesday, November 22, 2016 at 6:07:15 PM UTC+1, Boris Modylevsky wrote: > > I am getting an error while

Re: [ansible-project] error while creaing Big IP pool ussing anisble yaml script

2016-11-22 Thread Tim
For the second error, are you connecting to the bigips mgmt port? Or a self IP? -tim On Nov 22, 2016 2:14 PM, "santu chaitu" wrote: > > I am trying to create a pool using YAML as below (Note: I tried to > executed the script as root user and as non-rrot user) IN both

[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

[ansible-project] error while creaing Big IP pool ussing anisble yaml script

2016-11-22 Thread santu chaitu
I am trying to create a pool using YAML as below (Note: I tried to executed the script as root user and as non-rrot user) IN both cases i am getting two different errors. inventory file webl22-p1.gain.tcprod.local ansible_ssh_host=10.30.81.30 [webservers] webl22-p1.gain.tcprod.local

Re: [ansible-project] Re: Problem With Simple Template

2016-11-22 Thread Jon Forrest
On 11/22/16 12:20 PM, Dick Davies wrote: On the 'how do i apply roles to specific hosts, I'd go for a full ntp_server role and an ntp_client role. Then your site.yml looks like I appreciate you taking the time to follow up on this. [...] I wish our environment were that simple. However,

Re: [ansible-project] How to find network device by macaddress ?

2016-11-22 Thread Kai Stian Olstad
On 22. nov. 2016 21:18, Don Jackson wrote: > Here is a truncated version of a fact for one network interface on a server: > > "ansible_eth2": { > "active": true, > "device": "eth2", > "macaddress": "30:0e:d5:cb:11:fe", > "type": "ether" >

Re: [ansible-project] Scaling the Ansible Hierarchy?

2016-11-22 Thread Kai Stian Olstad
On 22. nov. 2016 20:25, burns...@umn.edu wrote: > Ok so I ended up rolling back to playbooks in the top level directory. > > I got myself turned around a bit here. The {{roles_path}} as part of the > include actually wasn't working; which, I should have known since you can't > use ansible.cfg

Re: [ansible-project] Scaling the Ansible Hierarchy?

2016-11-22 Thread Kai Stian Olstad
On 22. nov. 2016 19:53, burns...@umn.edu wrote: > However, it seems that my plays can no longer find my group_vars and other > such objects. Basic structure is below: > ansible.cfg > .ansible/inventory > playbooks/ >pb.yml > roles/ > # roles... > host_vars/ > # host_vars... > group_vars/

Re: [ansible-project] Re: Problem With Simple Template

2016-11-22 Thread Dick Davies
On the 'how do i apply roles to specific hosts, I'd go for a full ntp_server role and an ntp_client role. Then your site.yml looks like --8<--- - hosts: ntpservers roles: - ntp_server - hosts: servers roles: - ntp_client - presumably_something_useful

[ansible-project] How to find network device by macaddress ?

2016-11-22 Thread Don Jackson
Here is a truncated version of a fact for one network interface on a server: "ansible_eth2": { "active": true, "device": "eth2", "macaddress": "30:0e:d5:cb:11:fe", "type": "ether" }, And there are similar facts for each network

Re: [ansible-project] single item lists?

2016-11-22 Thread Brian Coca
The task executes once per item, I'm guessing it failed on the first one. -- Brian Coca -- 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

[ansible-project] Re: Ansible in the docker container?

2016-11-22 Thread Steven Truong
I did try to reduce the size of Ansible and it is not worth it. I could only reduce around 4 MBs off the total size of the container. On Monday, November 7, 2016 at 5:18:34 PM UTC-8, Steven Truong wrote: > > Hi all, > > Am I being too picky here or just being naive in the ways I approach my >

Re: [ansible-project] Scaling the Ansible Hierarchy?

2016-11-22 Thread 'Jeffrey Wen' via Ansible Project
When you run the ansible-playbook, what about prefixing the command with ANSIBLE_ROLES_PATH. For example: ANSIBLE_ROLES_PATH=your_path ansible-playbook site.yml On Tuesday, November 22, 2016 at 2:25:08 PM UTC-5, burn...@umn.edu wrote: > > Ok so I ended up rolling back to playbooks in the top

Re: [ansible-project] Scaling the Ansible Hierarchy?

2016-11-22 Thread burns498
Ok so I ended up rolling back to playbooks in the top level directory. I got myself turned around a bit here. The {{roles_path}} as part of the include actually wasn't working; which, I should have known since you can't use ansible.cfg parameters in tasks like that. I think my main problem is

Re: [ansible-project] Scaling the Ansible Hierarchy?

2016-11-22 Thread burns498
Thanks for the info! I tried this in my own environment, since I actually had a similar question before. Moved playbooks to a playbooks dir. Set role_path=./roles. This broke my include statements, which I now modified to '- include: "{{ roles_path }} /role_handlers_ant/handlers/main.yml"'.

Re: [ansible-project] Scaling the Ansible Hierarchy?

2016-11-22 Thread 'Jeffrey Wen' via Ansible Project
Thank you, Kai! That works for me! On Tuesday, November 22, 2016 at 12:38:00 PM UTC-5, Kai Stian Olstad wrote: > > On 21. nov. 2016 16:38, 'Jeffrey Wen' via Ansible Project wrote: > > *Question*: What is the solution to not overfilling my top-level > directory > > with yml files? (Or is this

Re: [ansible-project] Make ansible-playbook accept a roles-path argument?

2016-11-22 Thread 'Jeffrey Wen' via Ansible Project
Hey James, Your solution for using ANSIBLE_ROLES_PATH works! I am having issues trying to find out where the *constants.py* file is that you're talking about. On Tuesday, February 10, 2015 at 8:57:17 AM UTC-5, James Cammarata wrote: > > No problem. By design, every configuration option has a

Re: [ansible-project] Ansible Playbook - when: list?

2016-11-22 Thread 'Jeffrey Wen' via Ansible Project
Thank you! On Tuesday, November 22, 2016 at 12:53:52 PM UTC-5, Kai Stian Olstad wrote: > > On 21. nov. 2016 19:14, 'Jeffrey Wen' via Ansible Project wrote: > > localhost | SUCCESS => { > > "ansible_facts": { > > "ansible_dns": { > > "nameservers": [ > >

Re: [ansible-project] Adding dict key to a list

2016-11-22 Thread Kai Stian Olstad
On 22. nov. 2016 15:11, William Hirsch wrote: > Now, here is what I want to do to each device I find that doesn't match > sr0. I'm struggling in figuring out how to set new_dev > > - name: Label new disk > command: parted -s -a optimal "{{ new_dev }}" mklabel gpt > > I've tried the following

Re: [ansible-project] Changing variable depending on the host within a role

2016-11-22 Thread Kai Stian Olstad
On 22. nov. 2016 11:14, Adnan Arab wrote: > I want to be able to change the value of a variable depending on a host. > > What I tried was roles/x/vars/host_vars//main.yml but this does not > seem to work. > > Could you please let me know how I can change a variable depending on a > host within

Re: [ansible-project] Ansible Playbook - when: list?

2016-11-22 Thread Kai Stian Olstad
On 21. nov. 2016 19:14, 'Jeffrey Wen' via Ansible Project wrote: > localhost | SUCCESS => { > "ansible_facts": { > "ansible_dns": { > "nameservers": [ > "192.168.1.1", > "192.168.1.2" > ], > "search": [ >

Re: [ansible-project] Regression in 'package' module?

2016-11-22 Thread Brian Coca
can you run with -vvv and show that output? also can you check the value of asnible_pkg_mgr? -- Brian Coca -- 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

Re: [ansible-project] Can conditional "OR" operator be syntactically indented similar to the "AND" operator?

2016-11-22 Thread burns498
Thanks Brian! That YAML multiline notation worked out wonderfully for this. Thanks for educating me! On Tuesday, November 22, 2016 at 9:13:24 AM UTC-6, Brian Coca wrote: > > Not that way but you can use YAML multiline > > failed_when: > >expect_output.stdout | search("(ORA|SP2)-[0-9]+") or >

Re: [ansible-project] Can conditional "OR" operator be syntactically indented similar to the "AND" operator?

2016-11-22 Thread burns498
Hey Brian - That list notation worked out wonderfully. Thanks for educating me! On Tuesday, November 22, 2016 at 9:13:24 AM UTC-6, Brian Coca wrote: > > Not that way but you can use YAML multiline > > failed_when: > >expect_output.stdout | search("(ORA|SP2)-[0-9]+") or >

Re: [ansible-project] Scaling the Ansible Hierarchy?

2016-11-22 Thread Kai Stian Olstad
On 21. nov. 2016 16:38, 'Jeffrey Wen' via Ansible Project wrote: > *Question*: What is the solution to not overfilling my top-level directory > with yml files? (Or is this normal?) At you top level, create a directory called playbooks (or choose you favorite name). Then you can run

[ansible-project] Failed to install ansible on Ubuntu 14

2016-11-22 Thread Boris Modylevsky
I am getting an error while installing ansible on Ubuntu 14: x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -DUSE__THREAD -I/usr/include/ffi -I/usr/include/libffi -I/usr/include/python2.7 -c c/_cffi_backend.c -o

[ansible-project] Changing variable depending on the host within a role

2016-11-22 Thread Adnan Arab
Hi, I want to be able to change the value of a variable depending on a host. What I tried was roles/x/vars/host_vars//main.yml but this does not seem to work. Could you please let me know how I can change a variable depending on a host within a role? Thanks -- You received this message

Re: [ansible-project] single item lists?

2016-11-22 Thread nusenu
Brian Coca: > when an argument is defined as a list, it is always a list, even if you > only supply one element. Yes, that is what I actually expect. and that is why I do not understand that name is set to the entire list instead of the first (and only) item of the list if I use it in a

[ansible-project] Re: Error in creating instance (Inner Exception: create() takes at least 4 arguments (9 given))

2016-11-22 Thread misko bat
Hello, for those who were lead to this page by Google search. If you run into messages like "Error in creating instance (Inner Exception: create() takes at least 4 arguments (10 given))"} or Error in creating instance (Inner Exception: Missing imageRef attribute (HTTP 400)) Then it

[ansible-project] adding roles at run time and include_role

2016-11-22 Thread Spike
Hi there, first post here so just a quick thank you to everybody who has contributed to ansible, it'a fantastic piece of software. I'm trying to specify hosts and roles at run time from cli while using a template playbook like this: # ideal playbook --- - hosts: "{{var_hosts}}" roles:

[ansible-project] Fundamental Template Problem

2016-11-22 Thread Jon Forrest
(Ansible 2.2 - Mac OS 12.1) I'm having trouble with a template I'm trying to create. So, I cut it down to a bare minimum. Consider the following: jon.yml - --- - name: big test hosts: all gather_facts: no tasks: - debug: var=inventory_hostname -

[ansible-project] Scaling the Ansible Hierarchy?

2016-11-22 Thread 'Jeffrey Wen' via Ansible Project
Hello, I am currently following the directory layout provided by Ansible. I understand that if I keep all of my roles/* in a directory, I can easily call each role from the top level directory like so: site.yml

[ansible-project] Adding dict key to a list

2016-11-22 Thread William Hirsch
All, I need some help writing the following task. 1. Need to find all devices on a RHEL system, but only if they don't match sr0 2. For each of those devices found, run a number of tasks against them Thought this would be a simple matter of accessing items in a dict or list, using *when:* to

[ansible-project] Ansible Playbook - when: list?

2016-11-22 Thread 'Jeffrey Wen' via Ansible Project
localhost | SUCCESS => { "ansible_facts": { "ansible_dns": { "nameservers": [ "192.168.1.1", "192.168.1.2" ], "search": [ "example.com", ] } }, "changed": false } *I am

Re: [ansible-project] single item lists?

2016-11-22 Thread Brian Coca
when an argument is defined as a list, it is always a list, even if you only supply one element. -- Brian Coca -- 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

Re: [ansible-project] Can conditional "OR" operator be syntactically indented similar to the "AND" operator?

2016-11-22 Thread Brian Coca
Not that way but you can use YAML multiline failed_when: > expect_output.stdout | search("(ORA|SP2)-[0-9]+") or expect_output.stdout | search("Usage") ​The lis​t notation is just that, a list of conditionals which all must be true , which ends up being an implicit AND. -- Brian

Re: [ansible-project] Re: Problem With Simple Template

2016-11-22 Thread Jon Forrest
On 11/22/16 12:14 AM, Dick Davies wrote: That playbook tells ansible to create the template on the 'all' group i.e. everything in the inventory. That's what it's trying to do. The moment I read this I realized my mistake. You're absolutely right! I had stupidly been thinking that this would

Re: [ansible-project] single item lists?

2016-11-22 Thread nusenu
> "failed": true, > "invocation": { > "module_args": { > "build": false, > "name": "['tor']", > "ports_dir": "/usr/ports", > "state": "present" > } > }, > "item": [ > "tor" > ], > "msg": "Can't find

Re: [ansible-project] 'package' module does not like "{{ item }}" ?

2016-11-22 Thread nusenu
turns out this role commit introduced the problem, it replaces the static string "tor" with the generic "{{ item }}". https://github.com/nusenu/ansible-relayor/commit/06eaad05443f5282b4ac74af688a5f6e60e45b83#diff-2444ad0870f91f17ca6c2a5e96b26823 -- You received this message because you are

[ansible-project] Regression in 'package' module?

2016-11-22 Thread nusenu
Hi, I recently migrated from OS specific modules to the 'package' module to reduce the number of tasks [1]. At the time I used ansible 2.0 (and IIRC it worked but I'm not 100% sure). Now I'm running ansible 2.2 and apparently the package module on OpenBSD targets does not seem to use the

Re: [ansible-project] Re: Problem With Simple Template

2016-11-22 Thread Dick Davies
That playbook tells ansible to create the template on the 'all' group i.e. everything in the inventory. That's what it's trying to do. for your use case, just make 2 roles: ntp_server and ntp_client, and apply them to groups as required. On 22 November 2016 at 05:58, Jon Forrest