Re: [ansible-project] Custom Fact - Drill down into each variable

2017-07-04 Thread Anfield
Thanks. It works now Changed the playbook line to this and it works fine -> debug: msg="Custom facts are {{ansible_local.preference.general.material}}" Output - PLAY [localhost] *** TASK [Gathering Facts]

Re: [ansible-project] Custom Fact - Drill down into each variable

2017-07-04 Thread Kai Stian Olstad
On 04.07.2017 19:58, Anfield wrote: Created a custom fact which only seems to work when not executable - etc/ansible/facts.d/preference.fact [new facts] material = concrete structure = square I highly recommend against using spaces in fact keys. You must likely will have a lot of problems if

[ansible-project] Re: Playbook that uses become only if root user not specified?

2017-07-04 Thread ajay jiwanand
A very simple fix was to just change become:true to become:yes and root authentication works as long as you dont specify sudo password in command line (-K) and specify root account with -u On Tuesday, July 4, 2017 at 1:46:05 PM UTC-4, ajay jiwanand wrote: > > Hey Daniel, > > That definitely

[ansible-project] Custom Fact - Drill down into each variable

2017-07-04 Thread Anfield
Created a custom fact which only seems to work when not executable - etc/ansible/facts.d/preference.fact [new facts] material = concrete structure = square When the preference.fact is set to executable I get the following error - TASK [Gathering Facts]

[ansible-project] Custom fat drill down, and error message

2017-07-04 Thread Anfield
I have a custom fact as follows - /etc/ansible/facts.d/preference.fact [new facts] material = concrete structure = square When this is not executable, it works, when it is executable it throws an error (shown below) TASK [Gathering Facts]

[ansible-project] Re: Playbook that uses become only if root user not specified?

2017-07-04 Thread ajay jiwanand
Hey Daniel, That definitely looks like it can work but that would mean that I would have to specify one password for sudo accross all devices? As there are tons of devices and tons of "admin" accounts for users who are able to perform these action it wont be possible for me to place one

[ansible-project] getting key:value from fact

2017-07-04 Thread Jan Mattsson
I am trying to get back into some Ansible automation after some absence but get stuck immediately trying to get the IP address of an Azure VM from ansible facts: ok: [localhost] => { "*interface_facts.ansible_facts.azure_networkinterfaces*": [ { "etag":

[ansible-project] Re: Join the first Ansible Windows Sprint

2017-07-04 Thread 'jhawkesworth' via Ansible Project
Just a little reminder this is happening later today (well its later today in my timezone) Hope you can join us. Jon On Wednesday, June 28, 2017 at 9:47:44 AM UTC+1, Dag Wieers wrote: > > Hi, > > So one of the problems we want to tackle with Ansible Sprints is to > bring down the number of

Re: [ansible-project] Re: Facing Ansible bug & how to use the most recent Ansible branch with fixed code ?

2017-07-04 Thread jean-yves
Perhaps related to : https://github.com/ansible/ansible/pull/24768 Le 4 juillet 2017 16:00:43 GMT+02:00, P a écrit : >Anyone experiencing the same bug ? Or not ? > >On Friday, June 23, 2017 at 9:26:54 AM UTC+1, P wrote: >> >> Sorry - I haven't sent any update but after I

Re: [ansible-project] Alternative Directory Layout fails to load group_vars with -i inventories

2017-07-04 Thread Vasco Barroso
Thanks for the answer. The group_vars and host_vars directories are adjacent to the hosts file, so it should work right ? Not sure I fully understand your point about 'recursive directory'. I've finally solved the issue by putting individual inventories in separate top level directories (not

Re: [ansible-project] Re: Facing Ansible bug & how to use the most recent Ansible branch with fixed code ?

2017-07-04 Thread P
Anyone experiencing the same bug ? Or not ? On Friday, June 23, 2017 at 9:26:54 AM UTC+1, P wrote: > > Sorry - I haven't sent any update but after I sent this post did the same > test with devel branch and have the same error. > Raised a bug: https://github.com/ansible/ansible/issues/25967 > >

Re: [ansible-project] Re: AWS Ansible

2017-07-04 Thread Dick Davies
No, just keep it simple and set the environment variables; then you can't accidentally commit credentials to a repo or use the wrong account. http://docs.ansible.com/ansible/guide_aws.html On 4 July 2017 at 11:33, Suporter wrote: > Sorry, i dont really know where to

[ansible-project] Re: SSL error with gce_instance_template and ansible

2017-07-04 Thread sushrismita . mishra
If anyone is facing the same issue , hope this will solve the issue the certifi==2015.04.28 version fixed the issue with google modules. Not sure at this point , if it broke anything else. Reference URL: https://github.com/omab/python-social-auth/issues/566 On Monday, June 19, 2017 at 9:05:29

Re: [ansible-project] Re: AWS Ansible

2017-07-04 Thread Suporter
Sorry, i dont really know where to start, Should i save the keys in some file and refer that fiile in the playbook as a variable? On Tuesday, July 4, 2017 at 3:53:38 PM UTC+5:30, Dick Davies wrote: > > Sorry I thought you wanted to know about file lookups (in this case > it's ssh keys). > >

Re: [ansible-project] Re: AWS Ansible

2017-07-04 Thread Dick Davies
Sorry I thought you wanted to know about file lookups (in this case it's ssh keys). If the -e 'credentials=/path/to/credentials' , you just need to lookup the file and read it's contents. Or just set environment variables before you run the playbook, I thought the aws related modules read the

[ansible-project] Re: AWS Ansible

2017-07-04 Thread Suporter
Oh my god, my head is spinning. I have 3 accounts in AWS, i need to create a file for each account? and then i need to give that name in playbook? i am expecting something like this ansible-playbook newmachine.yml --extra-vars "account=myaccount" and i want the new ec2 instance to be spinned

Re: [ansible-project] Re: starting karaf with ansble

2017-07-04 Thread fanvalt
Sorry I finally found out the issue was not in the start command and then happens in both ways , manually and with ansible. Don't pay attention to this ticket, I will keep searching about the issue but it has no link with an ansible issue. Thank you for your help, Regards Le mardi 4 juillet

Re: [ansible-project] Re: starting karaf with ansble

2017-07-04 Thread Dick Davies
Is this an init script? It sounds like it relies on something in the environment. Does it start at boot cleanly? If not, that's almost certainly the issue, you might find setting some variables explicitly in the init script sorts things out. On 4 July 2017 at 08:31, fanvalt

Re: [ansible-project] Re: AWS Ansible

2017-07-04 Thread Dick Davies
Yes, you can use lookups, like this - name: set authorized_keys authorized_key: user={{ item }} exclusive=yes key="{{ lookup('file', 'files/pubkeys/{{ item }}.key') }}" with_items: "{{ team_members[team] }}" team_members[team] here is a list of usernames, the files live in

[ansible-project] Re: AWS Ansible

2017-07-04 Thread Suporter
Is there a way to store all accounts keys as some files and call them as extra vars in playbook? On Monday, July 3, 2017 at 2:28:29 PM UTC+5:30, Darragh Grealish wrote: > > Yes, you pass them as extra-vars, but there are many ways to do this, just > watch out where you run your playbook and if

[ansible-project] Re: starting karaf with ansble

2017-07-04 Thread fanvalt
I did display the variables when running the start command and I cannot find out which variable would be a problem. Any clue ? Regards Here are the variables set when the error message is displayed: A__z='"*SHLVL="*TMOUT' BASH=/bin/sh

Re: [ansible-project] get_url runs but doesnt download the file

2017-07-04 Thread 'J Hawkesworth' via Ansible Project
The output above seems to be saying that the file /home/ansible/index.html is present on 10.10.0.5. If you are expecting the file to be re-downloaded each time the playbook runs, then set 'force: yes' in your playbook, otherwise it will not attempt to fetch the file again. Jon On Monday,

Re: [ansible-project] is it possible to open a file locally, read the content and push it to a remote host?

2017-07-04 Thread Kai Stian Olstad
On 03.07.2017 20:14, Danilo Braga wrote: But with the "with_lines", is it possible to run the command remotely at the switch? with_lines do not have this ability, it only read one line at a time and hand it over to the module. So if the module run on the remote, it will run on the remote.

[ansible-project] Re: Playbook that uses become only if root user not specified?

2017-07-04 Thread Daniel JD
You could use something like the following: - name: Set sudo Passwort set_fact: ansible_become_pass: "{{ my_encrypted_password }}" when: ansible_user == 'non-root-user' Am Dienstag, 4. Juli 2017 05:03:08 UTC+2 schrieb ajay jiwanand: > > I am writing a playbook that will cover a wide