Re: [ansible-project] Re: add_host module returns 'NoneType' object has no attribute 'add_group'

2015-08-19 Thread David Neudorfer
Thanks for the suggestion Brian and senorsmile but I realized after creating a task that ensures the tags exist before running the add_host module I don't think this has anything to do with the api. The add_host task is just adding the IP address of the instance to a group TASK: [cep_aws | add

[ansible-project] Re: Bug? Windows - Ansible uses LDAP user not ansible_ssh_user!?!

2015-08-19 Thread Amir Luzon
yes it does, thank you. does this not seem like a bug? On Wednesday, August 19, 2015 at 2:40:53 PM UTC+3, J Hawkesworth wrote: I think this is because when you logged into the machine, as part of the login process a kerberos ticket has been cached for the user you logged in as. When

[ansible-project] Re: Ignoring errors in check mode

2015-08-19 Thread Albertdev
On Wednesday, August 19, 2015 at 12:37:59 PM UTC+2, J Hawkesworth wrote: Not tried myself but I wonder if you could use failed_when to reduce the boilerplate a little: http://docs.ansible.com/ansible/playbooks_error_handling.html#controlling-what-defines-failure I believe I did try

[ansible-project] Re: Bug? Windows - Ansible uses LDAP user not ansible_ssh_user!?!

2015-08-19 Thread J Hawkesworth
I think this is because when you logged into the machine, as part of the login process a kerberos ticket has been cached for the user you logged in as. When ansible runs, the winrm connection plugin determines that you want to connect via kerberos (there is a bit of guessing going on here,

Re: [ansible-project] Re: add_host module returns 'NoneType' object has no attribute 'add_group'

2015-08-19 Thread David Neudorfer
I'd love to use the wait_for module to ensure the tags exist before moving to the next step but I don't see a way to run a command like: aws ec2 describe-instances \ --filter \ Name=tag:ansible,Values=awsqa_helios_web \ Name=instance-state-code,Values=16 \ --query

[ansible-project] Manage Inventory in Ansible

2015-08-19 Thread satheesh kumar
Hi, Currently i'm using static inventory in ansible and have folder structure like Inventories/inv1, Inventories/inv2, etc.. # Inventories/inv1 [atlanta] xyz.com [europe] abc.com I need to have group variables for production in a way like Inventories/group_vars/production which is specific

Re: [ansible-project] Manage Inventory in Ansible

2015-08-19 Thread Serge van Ginderachter
# Inventories/inv1 [atlanta] xyz.com [europe] abc.com I need to have group variables for production in a way like Inventories/group_vars/production which is specific to Prod. #Inventories/group_vars/production --- url: 'jnp://mqendpoint.company.com:1099' env: 'Production' How can

[ansible-project] using default(omit) in a template

2015-08-19 Thread tahonezz
I am trying to use the following in a template var = {{ param | default(omit) }} when the template copied to the host , it looks like this var = __omit_place_holder__ced80263bbdf6fd69a66240ad5188ab4727dd7ad instead of what i was hoping to get which was #var = any ideas on how to achieve

Re: [ansible-project] Run a playbook with arbitrary host not in the inventory hosts list?

2015-08-19 Thread Peter Loron
Hi, Brian. I'm trying to run a playbook file which by definition must contain a hosts entry. When I run the ansible-playbook command with the -i flag, I get this: ansible-playbook -i '10.10.10.155,' -u root do_base_packages.yaml PLAY [dummy]

[ansible-project] Re: getting an error when using default(omit)

2015-08-19 Thread tahonezz
this was a user error. I had something else wrong in my playbook On Monday, August 17, 2015 at 10:53:03 AM UTC-7, taho...@gmail.com wrote: Hi - i have am trying to use the omit feature with my default like this default_availability_zone = {{ cinder_default_availability_zone |

Re: [ansible-project] using default(omit) in a template

2015-08-19 Thread Matt Martz
Something like: {% if param|default('MISSING') != 'MISSING' %} var = {{ missing }} {% else %} #var = {% endif %} There are probably other options as well, but this is largely what I use and what I see elsewhere. On Wed, Aug 19, 2015 at 12:18 PM, tahon...@gmail.com wrote: I am trying to use

Re: [ansible-project] fatal error when skipping includes

2015-08-19 Thread senorsmile
A! Thanks Serge. So it is applying in the same manner as roles apply args (e.g. tags: ). So, now to figure out how to default a split(). On Wednesday, August 19, 2015 at 10:09:32 AM UTC-7, Serge van Ginderachter wrote: On 19 August 2015 at 19:02, senorsmile senor...@gmail.com

[ansible-project] Re: Manage Inventory in Ansible

2015-08-19 Thread satheesh kumar
Can you help me how to refer the group inside Inventories/Inventory1 ? -- 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

Re: [ansible-project] fatal error when skipping includes

2015-08-19 Thread senorsmile
And I've run into this bug yet again! I have the following which fails on skipped hosts: - name: Check all other host certs connection: local sudo: false stat: path: {{ role_path }}/templates/ca/{{ item }}.crt with_items: {{

Re: [ansible-project] fatal error when skipping includes

2015-08-19 Thread senorsmile
@Brian, According to your comment in this issue: https://github.com/ansible/ansible/issues/11961 the when: of the include: gets run AFTER the with_xxx of the child file? This doesn't make any sense to me. If you are conditionally including a file, NOTHING in that file should be processed.

Re: [ansible-project] fatal error when skipping includes

2015-08-19 Thread Serge van Ginderachter
On 19 August 2015 at 19:02, senorsmile senorsm...@gmail.com wrote: the when: of the include: gets run AFTER the with_xxx of the child file? This doesn't make any sense to me. If you are conditionally including a file, NOTHING in that file should be processed. I am not being combative, but

Re: [ansible-project] Using ansible's inventory to ssh

2015-08-19 Thread Michael Peters
Sounds like you're wanting to be able to ssh to a machine based on it's name instead of it's ip address. DNS is the obvious answer. If not that, then maybe create an ansible playbook that generates an /etc/hosts file for your control server based on the servers in the inventory. Then you can just

[ansible-project] Using ansible's inventory to ssh

2015-08-19 Thread Brian Picciano
Hi there! Sorry if this has been asked before, I searched quite a bit and wasn't able to find anything of this nature. We have our ansible repo with our inventory and all of that fun stuff. Currently our inventory is static, but at some point in the future we''ll likely switch to a dynamic

Re: [ansible-project] fatal error when skipping includes

2015-08-19 Thread senorsmile
Ultimately fixed this by simply putting this into the role's defaults/main.yml nagios_host_fqdns_flat: ([]) On Wednesday, August 19, 2015 at 10:20:38 AM UTC-7, senorsmile wrote: A! Thanks Serge. So it is applying in the same manner as roles apply args (e.g. tags: ). So, now to

[ansible-project] Installing dependencies for python-kerberos with different package managers (Portage, pkg, OpenCSW, Pacman) and OS X

2015-08-19 Thread roger
Hi everyone, I'm writing a pull request https://github.com/ansible/ansible/pull/11792 to update the dependencies for installing the python-kerberos library [pip python-kerberos] and running the kinit/klist commands. I've confirmed the dependencies for yum and apt-get, but don't have access

Re: [ansible-project] Re: Manage Inventory in Ansible

2015-08-19 Thread Serge van Ginderachter
On 19 August 2015 at 19:43, satheesh kumar infosatheesh2...@gmail.com wrote: Can you help me how to refer the group inside Inventories/Inventory1 ? ​​ - ​i Inventories don't do -i Inventories/production - at least not how your example is laid out.​ -- You received this message

[ansible-project] Loading rvm in remote server before a playbook starts

2015-08-19 Thread Derrick Mar
Hello! Does anyone know how to load rvm in a playbook so that it's available in {{ ansible_env.PATH }} ? - name: Deploy my app environment: PATH: {{ ansible_env.PATH }} This does not include /home/ubuntu/.rvm/gems/ruby-2.2.2/wrappers -- You received this message because you are

Re: [ansible-project] Re: unarchive module fails

2015-08-19 Thread Thibaud Lepretre
I'm facing similar issue using centos 6.8. Archive is a simple tar archive without any compression. However issue only appears when using Packer and its ansible post process provisioner. When I disable this post process to get only VM and run ansible playbook myself locally `ansible-playbook

[ansible-project] msg: [Errno 2] No such file or directory when using bundle

2015-08-19 Thread Derrick Mar
Hello Ansible community! I'm just getting started with Ansible, and seem to be not understanding why this happens. My playbook - name: bundle install command: bundle install args: chdir: ~/ai_grading_production/ I get the error msg: [Errno 2] No such file or directory when

[ansible-project] Ansible Tower and requirements.yml

2015-08-19 Thread Dan
Hi I am having an issue with Ansible Tower not picking up the requirements.yml file that is needed for the playbook. The documentation (Here http://docs.ansible.com/ansible-tower/latest/html/userguide/projects.html#ansible-galaxy-support) says that tower looks for roles/requirements.yml

[ansible-project] Dynamic Inventory and ansible_ssh_ variables.

2015-08-19 Thread Michael Luich
Hello, I'm trying to write a custom inventory script that sets a non standard ssh port. I've put the ansible_ssh variables in the _meta section of the json. These variables don't seem to get applied. I can set it in /etc/ansible/group_vars/CDS.yml and it gets picked up. This example only

[ansible-project] apt module and per package releases

2015-08-19 Thread James Kruth
I'm trying to install packages from a specific release/distro (unstable) in Debian using `/unstable` syntax. Here's an example: ansible debian-virtual -m apt -a name=emacs24/unstable 10.211.55.17 | FAILED { failed: true, msg: No package matching 'emacs24/unstable' is

[ansible-project] Managing crontabs in FreeBSD

2015-08-19 Thread Francisco Reyes
From what I can tell, and looking at the cron program in the ansible directory, it does not seem the core cron management knows how to deal with FreeBSD. Has anyone run into any roles/snippets on managing cron jobs in FreeBSD? For now I am going to create files in /var/cron/tabs/UserName and

[ansible-project] Ansible-Playbook Return/Exit Codes

2015-08-19 Thread 'Ansible Madness' via Ansible Project
Could someone direct me to a list of ansible-playbook exit codes? So far I've seen 0 which appears to be all OK with changes, however I've also seen 2 and 3. Something official would be great rather than my assumptions :) I'm attempting to check the exit code of a playbook run to determine if

[ansible-project] how to set an environment variable in ansible ad-hoc command?

2015-08-19 Thread Yves Serrano
Hi there Is there in ansible a way so set an linux environment variable for a ad-hoc mode and store it permanently in some place? I tried host_vars, but that doesn't worked. I want to run this command: ansible all -m shell -a DEBIAN_FRONTEND=noninteractive apt-get upgrade” without the need to

[ansible-project] variable precedence seems hopelessly broken

2015-08-19 Thread Dan Stillman
I really like Ansible and have built a large infrastructure around it, but I'm finding it untrustworthy to the point of being unusable. In the last 9 months, I've reported 4 variable precedence bugs: https://github.com/ansible/ansible/issues?utf8=%E2%9C%93q=is%3Aissue+author%3Adstillman+ The

[ansible-project] ec2.py instance_filters all security groups except

2015-08-19 Thread justin
Using dynamic inventory with ec2.py am trying to filter based on all instance *except* where the security group is monolithic. I tried: instance_filters = !security_group:monolithic But this did not work. How is this possible? -- You received this message because you are subscribed to the

[ansible-project] Using dynamic inventory with ec2.py show tag name

2015-08-19 Thread justin
I am using dynamic inventory with the ec2.py and ec2.ini and it is working great, except that the output of: ansible all -m ping shows: 52.5.102.121 | success { changed: false, ping: pong } 54.5.16.113 | success { changed: false, ping: pong } 54.5.47.18 | success {

[ansible-project] Facts no longer available in lookup plugin

2015-08-19 Thread Christian Hammerl
Some time ago, I wrote a small lookup plugin https://github.com/mantiz/ansible-lookup-plugin-os-specific This plugin allows/allowed to define a list of items where each item could be specialized for a specific os or distribution. For this to work, I need the facts to access ansible_distribution

Re: [ansible-project] Using ansible's inventory to ssh

2015-08-19 Thread Brian Coca
someone was working on an ansible-ssh that does just that, sshs into an 'ansible defined host' -- 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

Re: [ansible-project] how to set an environment variable in ansible ad-hoc command?

2015-08-19 Thread Brian Coca
look at .ssh/rc file for setting up vars, but i would also recommend just using 'ansible -m apt -a upgrade=yes ' one of these days i'm just going to patch apt-get to automatically go non-interactive when stdin is not a tty -- Brian Coca -- You received this message because you are

[ansible-project] Re: Bug? Windows - Ansible uses LDAP user not ansible_ssh_user!?!

2015-08-19 Thread Amir Luzon
LDAP user is a user in the active directory. and ansible is then attempting to use your kerberos credentials to talk to your windows machines. - but we configured the ansible_ssh_user| to a specific user and it is not using that user but the user logged in to the control machine...why is that?

[ansible-project] Re: Ignoring errors in check mode

2015-08-19 Thread J Hawkesworth
Not tried myself but I wonder if you could use failed_when to reduce the boilerplate a little: http://docs.ansible.com/ansible/playbooks_error_handling.html#controlling-what-defines-failure Something like this (as I say, untested): --- - hosts: all name: testing tasks: - name:

[ansible-project] Re: Creating a new user with SSH rights on OS X

2015-08-19 Thread Anthony Green
the answer was to add the user to the ssh group and set the shell - name: Add jenkins user user: name=jenkins comment=Jenkins password=foobar groups=com.apple.access_ssh shell=/bin/bash sudo: yes -- You received this message because you are subscribed to the Google Groups Ansible Project

[ansible-project] Creating a new user with SSH rights on OS X

2015-08-19 Thread Anthony Green
I've been trying to use the group and user module to create a user account that has SSH rights. the tasks i'm running are: - name: Add jenkins user user: name=jenkins comment=Jenkins password=foobar system=yes sudo: yes and although the user is created SSH isn't set up properly: If I try

[ansible-project] Bug? Windows - Ansible uses LDAP user not ansible_ssh_user!?!

2015-08-19 Thread Amir Luzon
hi guys, our control machine is configured so that we can login to the machine with our LDAP (windows) users. from there we run ansible playbooks. here are some of the configurations we use: [windows:vars] ansible_ssh_user=[DeployUser]@[OurDomain] ansible_ssh_pass=password

Re: [ansible-project] Ansible-Playbook Return/Exit Codes

2015-08-19 Thread Brian Coca
no oficial docs, but this is from the new ansible binary in devel: except AnsibleOptionsError as e: cli.parser.print_help() display.error(str(e), wrap_text=False) sys.exit(5) except AnsibleParserError as e: display.error(str(e), wrap_text=False)

Re: [ansible-project] msg: [Errno 2] No such file or directory when using bundle

2015-08-19 Thread Brian Coca
bundle is not in your PATH, changing to a directory does not include it in your PATH (unless your PATH has ./ which is really not recommended). -- Brian Coca -- You received this message because you are subscribed to the Google Groups Ansible Project group. To unsubscribe from this group

Re: [ansible-project] Facts no longer available in lookup plugin

2015-08-19 Thread Brian Coca
the 3rd var passed into the run method are the host variables, which should include facts. -- 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

Re: [ansible-project] msg: [Errno 2] No such file or directory when using bundle

2015-08-19 Thread Marcus Franke
Hi You are running into a typical rvm error. I assume you have some special rvm ruby version with a custom gemset. The problem is, Ansible has to do the same rvm use ruby-2.1.5@gemset like you would do in your shell. Unless you are using the .ruby-(version|gemset) dotfiles. Ansible does not