[ansible-project] how do I email results that are easy to read and confirm each member was added successfully?

2019-04-18 Thread Dennis Levens
This script is working but the results are difficult to read in the email that is sent. Ideally I would like the email to say something like: The following Add: {{ member }} To: {{ group }} On: {{ ansible_hostname }} *[has failed or was successful]* The following are the current members of

Re: [ansible-project] Best way to pass the password to dynamic inventory script

2019-04-18 Thread Rakesh Kumar
I have already developed a scirpt. And plugin wont work in our current solution. I do not have plugins from ansible to use. So i developed a scirpt. Still need a solution to pass credentials to dynamicinventoryscirpt.py On Thu, Apr 18, 2019 at 11:15 AM Brian Coca wrote: > I would recommend

Re: [ansible-project] Ansible : ERROR! SSH encountered an unknown error during the connection

2019-04-18 Thread Kai Stian Olstad
On 18.04.2019 23:47, nilesh bhadane wrote: Its ubuntu version is xenial This has nothing to do with Ansible since it's a generic Linux question, but here goes. The PPA is here https://launchpad.net/~ansible/+archive/ubuntu/ansible In the upper right corner you'll see a link "View package

Re: [ansible-project] Ansible : ERROR! SSH encountered an unknown error during the connection

2019-04-18 Thread nilesh bhadane
Its ubuntu version is xenial *user@test-conrol-ansible*:*~*$ lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 16.04.6 LTS Release: 16.04 Codename: xenial On Thursday, April 18, 2019 at 2:39:25 PM UTC-7, Kai Stian Olstad wrote: > > On 18.04.2019

Re: [ansible-project] Ansible : ERROR! SSH encountered an unknown error during the connection

2019-04-18 Thread Kai Stian Olstad
On 18.04.2019 23:31, nilesh bhadane wrote: I have just 1-day experience on Ansible. Can you please tell me what deb package I have to download & from where? Without knowing your Ubuntu version that would be impossible. -- Kai Stian Olstad -- You received this message because you are

Re: [ansible-project] Ansible : ERROR! SSH encountered an unknown error during the connection

2019-04-18 Thread nilesh bhadane
I have just 1-day experience on Ansible. Can you please tell me what deb package I have to download & from where? On Thursday, April 18, 2019 at 2:20:13 PM UTC-7, Kai Stian Olstad wrote: > > On 18.04.2019 23:01, nilesh bhadane wrote: > > Hi, > > > > I am new the Ansible. I have setup ansible

Re: [ansible-project] Ansible : ERROR! SSH encountered an unknown error during the connection

2019-04-18 Thread Kai Stian Olstad
On 18.04.2019 23:01, nilesh bhadane wrote: Hi, I am new the Ansible. I have setup ansible on Ubuntu machine as follows : $ sudo apt-get update $ sudo apt-get install software-properties-common $ sudo apt-add-repository --yes --update ppa:ansible/ansible . ->> *My machine don't have

Re: [ansible-project] Ansible "ERROR! SSH encountered an unknown error during the connection

2019-04-18 Thread nilesh bhadane
I did this already. But still the same error. On Thursday, April 18, 2019 at 2:05:09 PM UTC-7, Gaetano Giacalone wrote: > > From your control host type ssh-copy-id -I (remote ip) to copy public key > > > > On Thu, Apr 18, 2019, 1:56 PM nilesh bhadane > wrote: > >> Hi, >> >> I am new the

Re: [ansible-project] Ansible "ERROR! SSH encountered an unknown error during the connection

2019-04-18 Thread Gaetano Giacalone
>From your control host type ssh-copy-id -I (remote ip) to copy public key On Thu, Apr 18, 2019, 1:56 PM nilesh bhadane wrote: > Hi, > > I am new the Ansible. I have setup ansible on Ubuntu machine. > > $ sudo apt-get update > $ sudo apt-get install software-properties-common > $ sudo

[ansible-project] Ansible : ERROR! SSH encountered an unknown error during the connection

2019-04-18 Thread nilesh bhadane
Hi, I am new the Ansible. I have setup ansible on Ubuntu machine as follows : $ sudo apt-get update $ sudo apt-get install software-properties-common $ sudo apt-add-repository --yes --update ppa:ansible/ansible . ->> *My machine don't have internet connection so this command didn't get

[ansible-project] Ansible "ERROR! SSH encountered an unknown error during the connection

2019-04-18 Thread nilesh bhadane
Hi, I am new the Ansible. I have setup ansible on Ubuntu machine. $ sudo apt-get update $ sudo apt-get install software-properties-common $ sudo apt-add-repository --yes --update ppa:ansible/ansible . ->> *My machine don't have internet connection so this command didn't get executed* $ sudo

Re: [ansible-project] user module on IBM AIX

2019-04-18 Thread klaasdemter
You can also use the linux hashes on AIX. https://www-01.ibm.com/support/docview.wss?uid=isg3T1027597 On 18.04.19 18:18, Brian Coca wrote: if the hash is the problem, probably a conditional assignment password: {{ ansible_os_distribution == 'AIX'|ternary( 'aix hashed', 'linux hashed') }}

Re: [ansible-project] Why does this if block + expression result in an undefined variable error?

2019-04-18 Thread Brian Coca
lazy evaluation prevents the error until the variable is actualy consumed, group1 is empty so [0] is pointing to 'the first host of a list w/o hosts', so the error is correct, you just avoid it in the first case because of the conditional. -- -- Brian Coca -- You received this message

Re: [ansible-project] Subsequent play do not runs when upper one fails

2019-04-18 Thread Brian Coca
put the previous play in a block and use 'rescue' to avoid total play faliure by design if a play fully fails, it terminates the current run -- -- Brian Coca -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from

[ansible-project] Use the version of the role as variable in a template

2019-04-18 Thread Werner Dijkerman
Hi, I'm curious if there is a Ansible variable available that I can use that describes the version of a role. In a requirements.yml file, like the following: - src: dj-wasabi.zabbix-server version: 1.4.0 A version can be configured and when executing the ansible-galaxy command it downloads

Re: [ansible-project] Ansible playbook execution | root restriction

2019-04-18 Thread Brian Coca
Don't assume Ansible just runs 'system commands', in many cases the modules use an API so 'list of system commands' is not something that will work. The modules themselves are executed under sudo/user from a temporary dir in their home, so you can 'match' more or less what that 'command' will

Re: [ansible-project] user module on IBM AIX

2019-04-18 Thread Brian Coca
if the hash is the problem, probably a conditional assignment password: {{ ansible_os_distribution == 'AIX'|ternary( 'aix hashed', 'linux hashed') }} -- -- Brian Coca -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe

Re: [ansible-project] Best way to pass the password to dynamic inventory script

2019-04-18 Thread Brian Coca
I would recommend using an inventory plugin instead, then you can use a vaulted inventory source with the credentials. -- -- Brian Coca -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop

Re: [ansible-project] Re: Access Vault Pass from inside dynamic inventory

2019-04-18 Thread Brian Coca
No, inventory scripts cannot use vault features, they are an 'external script' Ansible runs. Inventory plugins can by default, they will automatically unvault their inventory source file, since these are plugins that run internally in Ansible. - -- Brian Coca -- You received this

Re: [ansible-project] Ping module status in CSV

2019-04-18 Thread Vandana Thakur
Thanks , but how can i register this status simultaneously, since i need to call that status in csv . Also can i grep a specifuc string from ping module output n then define a customised result code and set that result code value in csv ? Thanks :) On Thu, 18 Apr 2019 at 18:44, S C Rigler

Re: [ansible-project] Installing packages from variable

2019-04-18 Thread Brian Coca
There is no specific docs about what is a list in each module as in general we accept [x, y, z] AND "x, y, z" everywhere we say 'list'. But it does seem to be a bug in not 'trimming' the list elements, which might not be an issue when using underlying CLI, but is probably hitting us when using

Re: [ansible-project] Re: please help

2019-04-18 Thread Brian Coca
when having connection problems use -vvv to show 'exact commands used', you probably have an ssh setting that is not working as you expect. -- -- Brian Coca -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this

Re: [ansible-project] Error while executed yml file

2019-04-18 Thread Brian Coca
The sudo: has been deprecated for a long time and recently remove use `become: yes` instead -- -- 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

Re: [ansible-project] ansible script to do remote execution of templates

2019-04-18 Thread Brian Coca
The fileglob lookup, like ALL lookups (https://docs.ansible.com/ansible/latest/plugins/lookup.html#lookup-plugins), always runs on the controller The template action plugin can ONLY use as source files on the controller.

Re: [ansible-project] format of the /etc/ansible/hosts file

2019-04-18 Thread Brian Coca
'hosts file format' is not a single thing, we have several ones to choose from, by default 'ini-ish', yaml and toml, it is plugin based so you can basically use any format you want as long as there is a plugin for it. -- -- Brian Coca -- You received this message because you are

Re: [ansible-project] Re: how to set python interpreter between different roles

2019-04-18 Thread Brian Coca
First, I would use 'defaults/main.yml' instead of vars, it has lower precedence, also look into: roles: - name: X vars: ansible_python_intepreter: /path/x or set in block inside the role that needs it, which would keep it from bleeding over. Role vars/ and defaults/ are meant

Re: [ansible-project] When: inventory_hostname not in ./my_file.txt

2019-04-18 Thread Brian Coca
assuming the file is 'local on the controller': when: lookup('pipe', 'grep ' + inventory_hostname + ' ../myfile.txt' otherwise use the 'find' plugin with 'contains', register results and use conditional on that. -- -- Brian Coca -- You received this message because you are

[ansible-project] Need help for parsing json

2019-04-18 Thread fred goasmat
Hello, In his playbook below I'trying to assert that there only one ingress rule (tcp on port 443 with cidr 0.0.0.0/0) I 've difficulties to understand how to parse it --> help :) --- - name: test assert aws security rule Ok hosts: localhost gather_facts: no vars: elb_name:

Re: [ansible-project] [Ansible-project]

2019-04-18 Thread James Cassell
On Thu, Apr 18, 2019, at 9:50 AM, vikram acharya wrote: > Hello Jonathan > > Thanks for support can you help with more detail If possible.. am kind of > new ansible world .. is their any mistake in play book ? > > You need 'gather_facts: yes' V/r, James Cassell > > > On Thu, Apr 18,

Re: [ansible-project] [Ansible-project]

2019-04-18 Thread Vijay Ravindran
Viktam, As a work around try updating as "ansible_os_family": "RedHat", as per the document provided by Jon. On Thu, Apr 18, 2019 at 7:21 PM vikram acharya wrote: > Hello Jonathan > > Thanks for support can you help with more detail If possible.. am kind of > new ansible world .. is their

Re: [ansible-project] [Ansible-project]

2019-04-18 Thread vikram acharya
Hello Jonathan Thanks for support can you help with more detail If possible.. am kind of new ansible world .. is their any mistake in play book ? On Thu, Apr 18, 2019, 19:12 Jonathan Lozada De La Matta wrote: > >

Re: [ansible-project] [Ansible-project]

2019-04-18 Thread Jonathan Lozada De La Matta
https://docs.ansible.com/ansible/latest/user_guide/playbooks_variables.html#variables-discovered-from-systems-facts On Thu, Apr 18, 2019 at 9:36 AM vikram acharya wrote: > Hello team , > > Am trying to install lamp i have written playbook in this manner . My > system are system connected AWS i

[ansible-project] [Ansible-project]

2019-04-18 Thread vikram acharya
Hello team , Am trying to install lamp i have written playbook in this manner . My system are system connected AWS i can do ssh to Redhat node from Ansible control server Need help to resolve the problem --- - hosts: all become: yes gather_facts:no tasks: - name: fail for other platform fail:

Re: [ansible-project] Ping module status in CSV

2019-04-18 Thread S C Rigler
Maybe use the value of "ping_res.rc". It's the return code of the command; so it would be "0" for success. Eg: {{ (ping_res.rc|int == 0) | ternary('UP', 'DOWN') }} --Steve On Thu, Apr 18, 2019 at 12:15 AM Vandana Thakur wrote: > Hello Team, > > I have created a csv for gathered facts of

Re: [ansible-project] win_copy azure ansible module not working

2019-04-18 Thread dan
On Thursday, April 18, 2019 at 4:19:15 AM UTC, gottumukkala srija wrote: > > [WARNING]: Unable to parse /home/f2/.ansible/inventory as an inventory > source > > [WARNING]: No inventory was parsed, only implicit localhost is available > > [WARNING]: provided hosts list is empty, only localhost

Re: [ansible-project] List of items in deb parameter of apt module

2019-04-18 Thread Dick Visser
Sorry, too fast. There is a deb parameter! But according to https://docs.ansible.com/ansible/latest/modules/apt_module.html that parameter does not support a list argument. The "name" parameter does. The porting guide says this explicitly: "Instead of relying on implicit squashing, tasks should

Re: [ansible-project] List of items in deb parameter of apt module

2019-04-18 Thread Dick Visser
The apt module does not have a "deb" parameter. Use "name" instead. https://docs.ansible.com/ansible/latest/modules/apt_module.html On Thu, 18 Apr 2019 at 10:41, wrote: > > Hi! > > Since the with_items are going to be deprecated and following the porting > guide here: >

[ansible-project] List of items in deb parameter of apt module

2019-04-18 Thread f . floimair . commend
Hi! Since the with_items are going to be deprecated and following the porting guide here: https://docs.ansible.com/ansible/latest/porting_guides/porting_guide_2.7.html I tried to rewrite some of my tasks where I am installing debian packages to use list format (which works with packages that

[ansible-project] When: inventory_hostname not in ./my_file.txt

2019-04-18 Thread ryad9200000
Hi all, I have this file "my_file.txt" with this content : 1,user1,host1 2,user2,host2 My inventory is : host5 I want condition "when" for skip same task if inventory_hostname is not in my file "my_file.txt" exemple : . same tasks . . *when: inventory_hostname not in ./my_file.txt* but

[ansible-project] Re: how to set python interpreter between different roles

2019-04-18 Thread christian . tremel
nobody? On Wednesday, April 17, 2019 at 11:56:48 AM UTC+2, christi...@itsv.at wrote: > > > so i have this play to do some rpm package management. this involves > removing the python package from the system. so i install some fallback > python package which should be used while the sytem