[ansible-project] Ansible - Generating OpenSSL Private Keys

2017-07-14 Thread Rod
Hello! I installed pyOpenSSL with this command: "yum install pyOpenSSL" Then I try to run an Ansible playbook which generates a public key but I got this error: "FAILED! => {"changed": false, "failed": true, "msg": "the python pyOpenSSL module is required}" Anyone knows why? I know I have

Re: [ansible-project] Become_user whose shell is /usr/sbin/nologin in Ansible 2.4

2017-07-14 Thread Mathias Ettinger
Sure, but on monday only :/. I don't have access to those machines from home. -- 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] Become_user whose shell is /usr/sbin/nologin in Ansible 2.4

2017-07-14 Thread Brian Coca
Can you show the verbose version of the play succeeding? -- 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] Ansible role variables

2017-07-14 Thread Trond Hindenes
I think I've seen this somewhere else as well. Maybe look into implementing it as a play using multiple include_role tasks instead? On Friday, July 14, 2017 at 5:01:50 PM UTC+2, Kai Stian Olstad wrote: > > On 12. juli 2017 17:03, Martin Jablečník wrote: > > Hello I have Ansible 2.3.0.0 with

Re: [ansible-project] Become_user whose shell is /usr/sbin/nologin in Ansible 2.4

2017-07-14 Thread Mathias Ettinger
This error is harmless. Hosts are openstack VMs configured from a single instance snapshot (so they are identical each time). The error is due to /etc/hosts not containing a reference to the content of /etc/hostname. I can provide an execution stack with this error removed on monday if need be.

[ansible-project] Re: task not running further after "Failed to connect to the host via ssh"

2017-07-14 Thread Vijayaraj Balakrishnan
I am using ansible 2.1.0.0 On Friday, 14 July 2017 17:01:31 UTC-5, Vijayaraj Balakrishnan wrote: > > hello, > I am running task on multiple nodes and task fails, when any one of the > node is unreachable. > > Any idea, how to overcome it. > > here is my Ansible Script. > > > > - hosts: > -

[ansible-project] task not running further after "Failed to connect to the host via ssh"

2017-07-14 Thread Vijayaraj Balakrishnan
hello, I am running task on multiple nodes and task fails, when any one of the node is unreachable. Any idea, how to overcome it. here is my Ansible Script. - hosts: - all name: Search APPID gather_facts: false serial: 1 become: no any_errors_fatal: false tasks: -

[ansible-project] Re: Ansible Certification

2017-07-14 Thread asudohfo97
Hi, How did your exam go? Did linuxacademy help you to pass or do you recommend other sources? Op dinsdag 20 december 2016 16:13:22 UTC+1 schreef jithendra myla: > > Hello Friends. > I am planning to take ansible certification in next 3 weeks, i see it's > 600 dollars, which i have to pay from

Re: [ansible-project] Become_user whose shell is /usr/sbin/nologin in Ansible 2.4

2017-07-14 Thread Brian Coca
so this is the command: ssh -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o User=user -o ConnectTimeout=10 -o ControlPath=/home/kniyl/.ansible/cp/c01e80a299 -tt 172.20.34.42 '/bin/sh -c '"'"'sudo -H -S -p "[sudo via ansible, key=igumwenfzxlgcmexugwnmhdyisluhuet] password: " -u logstash

Re: [ansible-project] Host: command output differs on localhost and FQDN

2017-07-14 Thread Kai Stian Olstad
On 14. juli 2017 19:46, Listing wrote: This indeed seems to be the case when I compared paths. How is this possible? The 'remote' machine is the exact same machine as the 'localhost', I only just connect by FQDN. That is a feature with the shell. Most shell(at least sh and bash do) have two

[ansible-project] Neatest way to automate role installation

2017-07-14 Thread Listing
Hi guys, I want to install a role automatically via a playbook. But what would be the best way to do this? Is that by using the shell/command module and then 'ansible-galaxy install', or is there something better available? -- You received this message because you are subscribed to the Google

Re: [ansible-project] Host: command output differs on localhost and FQDN

2017-07-14 Thread Listing
Hi Dick, This indeed seems to be the case when I compared paths. How is this possible? The 'remote' machine is the exact same machine as the 'localhost', I only just connect by FQDN. On Friday, July 14, 2017 at 3:08:40 PM UTC+2, Dick Davies wrote: > > It'll be a path thing most likely. It's in

Re: [ansible-project] Playbook Failys atc copying ssh keys

2017-07-14 Thread Kai Stian Olstad
On 14. juli 2017 17:56, Anfield wrote: Thanks. So its clear why this didnt work. Can I ask you how I can tell the playbook to switch to root to execute the commands on the localhost with escalated privileges? What is do is adding all the public keys to the ansible configuration and copies it

Re: [ansible-project] Problem with running playbook on hosts with different Python versions

2017-07-14 Thread Brian Coca
Up to Ansible 2.3, python 2.4 is supported on the targets, but not all modules, specially those that depend on 3rd party libs are guaranteed to work. Starting in Ansible 2.4 we no longer support pytnon 2.4/2.5 on target machines. The controller has always required 2.6 and will continue to

[ansible-project] Problem with running playbook on hosts with different Python versions

2017-07-14 Thread Phonthip Namkaew
Python 2.4 is probably not supported. (..) Managed Node Requirement: You also need Python 2.6 or later. (..) -- 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] Problem with running playbook on hosts with different Python versions

2017-07-14 Thread Brian Coca
This is what ansible_python_interpreter is for http://docs.ansible.com/ansible/intro_inventory.html (it is in bottom 3rd of the page). -- Brian Coca -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and

[ansible-project] Problem with running playbook on hosts with different Python versions

2017-07-14 Thread mreagio
I wrote a simple playbook to collect information regarding OS version for all hosts in inventory: - name: "Get OS versions Ansible playbook" hosts: all gather_facts: no tasks: - name: "Fetch OS details" shell: "cat /etc/redhat-release" register: result - name: "Print

Re: [ansible-project] Re: Playbook gives inconsistent results

2017-07-14 Thread Brian Coca
As I mentioned in the ticket, this is not inconsistent, this is just how the rules for fatal and non fatal errors work. Since running only B gets a fatal error (no hosts left in play to continue) the play ends before the `meta` task, when any other host is left (like when you add A to the mix) the

Re: [ansible-project] Playbook Failys atc copying ssh keys

2017-07-14 Thread Dick Davies
sudo ansible-playbook . will work but then you're running the whole play as local root, which feels wrong. I can't think why you'd want to do that, if you aren't making changes to that host. In this example you're shipping public keys, there's no downside to having them locally (or better

Re: [ansible-project] Playbook Failys atc copying ssh keys

2017-07-14 Thread Anfield
Thanks. So its clear why this didnt work. Can I ask you how I can tell the playbook to switch to root to execute the commands on the localhost with escalated privileges? > -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe

[ansible-project] Re: Playbook gives inconsistent results

2017-07-14 Thread MKPhil
Here's a basic Playbook which has this functionality. All tasks run for servers A and B but fails when run only against B where B is a server that cannot be contacted. My point is that if I run this against Server B I should get the same result *regardless* of what other servers I run it

Re: [ansible-project] What are fire and forget tasks ?

2017-07-14 Thread Kai Stian Olstad
On 12. juli 2017 09:21, Philippe Eveque wrote: in my case I should have set async to 2 o 3 but it does not really matter as I do not wait at all (poll 0) If you were refereeing to this task, this statement is not entirely correct. - name: Reboot the system shell: sleep 2 && shutdown -r now

Re: [ansible-project] need help on multipath

2017-07-14 Thread Kai Stian Olstad
On 12. juli 2017 16:37, rakesh boinapally wrote: we usually perform lot of multipath tasks in our company. On a server if i want to configure multipath for disk aliases multipath -ll|egrep "dm-|size"|sed -e 's/\]/ /g'|sed -e 'N' -e 's/\n/ /'|awk '{print $6,$2}'|sed -e 's/\[size=//g'|sed -e

Re: [ansible-project] Ansible role variables

2017-07-14 Thread Kai Stian Olstad
On 12. juli 2017 17:03, Martin Jablečník wrote: Hello I have Ansible 2.3.0.0 with this roles in playbook: - { role: bwt-container, tags: ['bwt_en', 'bwt'], vars: { app_lang: "en" } } - { role: bwt-container, tags: ['bwt_de', 'bwt'], vars: { app_lang: "de" } } BWT application have various

Re: [ansible-project] Ansible Tower installation Failed with error

2017-07-14 Thread Andrew Latham
For tower questions and support please utilize https://access.redhat. com/products/ansible-tower-red-hat This mailing list is for the open source ansible project. On Tue, Feb 7, 2017 at 4:31 PM, wrote: > I am totally new to this ansible project. I tried the ansible

Re: [ansible-project] Creating environmental variable in ansible playbook

2017-07-14 Thread Kai Stian Olstad
On 14. juli 2017 14:06, Prakash Khadka wrote: I have created a playbook. I want to define environmental variables when I execute a task. - name: Executing scripts shell: sh /root/something.sh register: shell environment: SOMETHING: something This is not working. any idea?

Re: [ansible-project] Re: storing standard output to variable

2017-07-14 Thread Kai Stian Olstad
On 14. juli 2017 14:00, stel...@compucorp.co.uk wrote: ok i got it now i was missing the .stdout, because ansible register collects a bunch of other stuff , not just the standard output , so you for example - name: Get info shell: cat test.php p | grep -v "*" | grep "'database' =>"|

[ansible-project] Testing if nested variable is defined

2017-07-14 Thread Jozef Hartinger
Assume the following variable structure: vars: foo: bar: baz: 5 If I simply to: when: foo.bar.baz is defined this only checks the baz key. I still get a failure if e.g. foo.bar is not defined. (The error was: error while evaluating conditional (foo.bar.baz is defined): 'dict

[ansible-project] Playbook gives inconsistent results

2017-07-14 Thread Mathias Ettinger
Can you share a link to the issue that was closed or at least share the playbook so we can have a chance understanding what is going on. -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving

Re: [ansible-project] Playbook gives inconsistent results

2017-07-14 Thread Dick Davies
There's no way to figure out what's happening from just that description, did you provide a test case on github? On 14 July 2017 at 14:07, MKPhil wrote: > I've got a multi-task playbook - if I run it against Servers A & B, all > tasks run for both servers. If I run it

Re: [ansible-project] Host: command output differs on localhost and FQDN

2017-07-14 Thread Dick Davies
It'll be a path thing most likely. It's in your path on localhost, and not on the account you're using remotely. On 13 July 2017 at 22:05, Listing wrote: > Hi, > > I am trying to run the following playbook: > > --- > - hosts: mymachine.lan > become: true > tasks: > -

[ansible-project] Re: Creating environmental variable in ansible playbook

2017-07-14 Thread Olof Lundgren
I did not get that working either. I ended up putting my environment variables in the actual environment in Linux. Like this: export ANSIBLE_NET_USERNAME=vyos export ANSIBLE_NET_PASSWORD=password On Friday, July 14, 2017 at 2:06:02 PM UTC+2, Prakash Khadka wrote: > > I have created a

Re: [ansible-project] GitLab issues connecting to us-gov-west-1

2017-07-14 Thread Brian Long
Hi Brian, Thanks for the email. It might have been the push I needed to find the bug :) I wrote a small Python script to dive deeper into boto. When I googled how to list the regions,I was reminded of the differences in boto 2 vs boto 3. Then, I reviewed the mechanism I was using to install

[ansible-project] Creating environmental variable in ansible playbook

2017-07-14 Thread Prakash Khadka
I have created a playbook. I want to define environmental variables when I execute a task. - name: Executing scripts shell: sh /root/something.sh register: shell environment: SOMETHING: something This is not working. any idea? -- You received this message because you are

[ansible-project] Re: storing standard output to variable

2017-07-14 Thread stelios
ok i got it now i was missing the .stdout, because ansible register collects a bunch of other stuff , not just the standard output , so you mnust specify it, Thanks J for example - name: Get info shell: cat test.php p | grep -v "*" | grep "'database' =>"| cut -d ">" -f 2 | cut -d "'"

[ansible-project] Re: storing standard output to variable

2017-07-14 Thread 'J Hawkesworth' via Ansible Project
I suggest you do a - name: examine shell output debug: var: so_output and run with -v to see what you have stored in so_output variable. From memory you'll have stdout and stdout_lines attributes in so_output and possibly the same for stderr. Depending on what you are trying to

[ansible-project] storing standard output to variable

2017-07-14 Thread stelios
I want to be able to run a command such as cat or grep following and store the standard output into a variable i can use further down I tried to do the following but its wrong for example - name: Get info shell: cat test.php p | grep -v "*" | grep "'database' =>"| cut -d ">" -f 2 |

[ansible-project] Re: better way to manage users on unix machine

2017-07-14 Thread Suresh Prajapati
Thanks for the reply. Here is the adduser task https://gist.github.com/toddlers/cc2647a493be431964114b22a2eb01e8 On Friday, 14 July 2017 17:08:03 UTC+8, Listing wrote: > > Can you show me the playbook you are using? > > On Friday, July 14, 2017 at 9:01:35 AM UTC+2, Suresh Prajapati wrote: >>

[ansible-project] Task fails when using more than one with_items.

2017-07-14 Thread Olof Lundgren
I have a network module playbook that connect to vyos router and gathers some info. --- - name: play hosts: vyos gather_facts: no connection: local tasks: - name: vyos facts vyos_facts: gather_subset: "!config" - name: vyos command.

[ansible-project] Re: better way to manage users on unix machine

2017-07-14 Thread Listing
Can you show me the playbook you are using? On Friday, July 14, 2017 at 9:01:35 AM UTC+2, Suresh Prajapati wrote: > > Hi Guys, > > > I am using a list of users to define the exact set of user accounts I need > on all of my managed compute instances. > > For example: > > --- > users: > - {

[ansible-project] Re: Alternative for blockinfile in Ansible 1.9

2017-07-14 Thread Listing
Have you considered lineinfile? On Friday, July 14, 2017 at 9:14:14 AM UTC+2, Selvakumar Ponnusamy wrote: > > I know we can use blockinfile in Ansible 2. Is there any way to achieve > same in Ansible 1.9 > -- You received this message because you are subscribed to the Google Groups "Ansible

[ansible-project] Re: Ansible Error : Error while linking: [Errno 13] Permission denied

2017-07-14 Thread Mathias Ettinger
Even with passwordless sudo, you may still want to use become:yes to actually invoke the command using sudo. Le jeudi 13 juillet 2017 19:59:59 UTC+2, swapnil bendekar a écrit : > > Hello Folks, > > With Ansible(2.3.0.0) and python(2.6.6), executing ansible playbook from > webadmin user. >

[ansible-project] Become_user whose shell is /usr/sbin/nologin in Ansible 2.4

2017-07-14 Thread Mathias Ettinger
I've been using become:yes and become_user:logstash in a playbook to install extra plugins. It all works great with ansible 2.3.1.0. I mistakenly ran the playbook using the devel branch (2.4) and the shell module suddently broke. I still consider it a bug as it's a backward incompatible change

[ansible-project] async tasks not following remote_tmp settings

2017-07-14 Thread alan
Greetings, I think I'm having the same issue reported in #10054 , but using Ansible-2.3.0. A little background: I'm running an Ansible playbook on remote systems where the root directory (which includes /home dirs) is in read-only mode, so I

[ansible-project] Alternative for blockinfile in Ansible 1.9

2017-07-14 Thread Selvakumar Ponnusamy
I know we can use blockinfile in Ansible 2. Is there any way to achieve same in Ansible 1.9 -- 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] better way to manage users on unix machine

2017-07-14 Thread Suresh Prajapati
Hi Guys, I am using a list of users to define the exact set of user accounts I need on all of my managed compute instances. For example: --- users: - { name: 'foo', github: 'foo12', shell: '/bin/zsh' } - { name: 'boo', github: 'boo12', shell: '/bin/zsh' } deleted_users: - { name: