Re: [ansible-project] cloning a service for HA?

2017-08-24 Thread Dick Visser
Aha. But that means that the playbook isn't truly idempotent. I would recommend spending some time changing the role (I assume you're using https://github.com/Stouts/Stouts.openvpn) to be idempotent. I had to do similar work on roles that generate key materials on the remote host. What I ended up

Re: [ansible-project] cloning a service for HA?

2017-08-24 Thread pixel fairy
On Thursday, August 24, 2017 at 9:45:30 PM UTC-7, Dick Visser wrote: > > So you're running a playbook against one host, then want to clone the > resulting configuration state to other hosts? > As you already mentioned that sounds indeed like a lot of work. > Why not simply run the playbook

Re: [ansible-project] cloning a service for HA?

2017-08-24 Thread Dick Visser
So you're running a playbook against one host, then want to clone the resulting configuration state to other hosts? As you already mentioned that sounds indeed like a lot of work. Why not simply run the playbook against *all* the machines? Dick On Fri, 25 Aug 2017 at 03:28, pixel fairy

[ansible-project] Re: Parsing log files with timestamp Ansible

2017-08-24 Thread Soniya panwar
>> I want to find the recently created file under a folder and cat to the file for the contents updates which can be visible while running a play in output. use this play in your playbook you will get expected result: - name: safely use > shell: find /var/log/ -maxdepth 1 -type f

[ansible-project] Re: nesting of inventory file and include mechanisms

2017-08-24 Thread Soniya panwar
my understanding of your requirement is still not clear but as far as i understand you are trying to execute playbook for multiple hosts, avoiding duplicacy. one way to do that is using patterns like below: The following patterns address one or more groups. Groups separated by a colon indicate

[ansible-project] Filtering on a Template variable

2017-08-24 Thread Anfield
How can I filter a variable in a template so that I can extract a fact Trying to get the default ipv4 address from a template template.j2 ipv4 address ((ansible_default_ipv4 | grep address}} A similar format will work via command line but not via a template. Whats the correct formatting

[ansible-project] cloning a service for HA?

2017-08-24 Thread pixel fairy
when making a service thats set up remotely, in this case openvpn, id like to set it up on two machines that already have keepalived between them and have it listen on the floating address, so all requests will go to "active" instead of standby. Stouts.openvpn runs on a single host and does

[ansible-project] Re: Find files starting with -- Frustration

2017-08-24 Thread John Harmon
Perfect. Thank you. That was the information I needed. I saw the return values earlier in the documentation, but I assumed I didn't understand it. Thx for the debug info too, that will help me in the future. On Thursday, August 24, 2017 at 4:43:09 PM UTC-6, John Harmon wrote: > > Although

Re: [ansible-project] Find files starting with -- Frustration

2017-08-24 Thread Kai Stian Olstad
On fredag 25. august 2017 00.30.16 CEST John Harmon wrote: > Side question: Where can I find a list of debug output types for my vars > (ie. stdout, stdout_lines, etc)? Each module return different ting, best is to check documentation or just run - debug: var= > Thanks in advance > >

[ansible-project] Find files starting with -- Frustration

2017-08-24 Thread John Harmon
Although my current playbook doesn't look for ifcfg files directly, I am just trying to grab a list of files and it is failing. I can't, for the life of me, figure out why. If I change the find: to a command: and then run an ls, it works.. wondering if someone can put me on the right

[ansible-project] Find files starting with -- Frustration

2017-08-24 Thread John Harmon
Although my current playbook doesn't look for ifcfg files directly, I am just trying to grab a list of files and it is failing. I can't, for the life of me, figure out why. If I change the find: to a command: and then run an ls, it works.. wondering if someone can put me on the right

[ansible-project] Re: Win custom modules don't work after update to 2.3.1/2.3.2. How to proceed?

2017-08-24 Thread Jordan Borean
2.3 changed the way that we handled dictionaries from pscustomobjects to hashtables and the way that scripts were executed were dramatically changed to decrease the execution time. As jhawkesworth has mentioned there is a newer guide available for developing on Windows modules which isn't on

[ansible-project] Re: add user via adhoc

2017-08-24 Thread Tcpip
Hello Kai, First of all thanks for your time and help, I will try the changes tonight and send you tomorrow the update.! thanks! On Thursday, August 24, 2017 at 12:09:55 AM UTC-3, Tcpip wrote: > > Hi all > > I want to add users via adhoc commands > > ansible all -m user -a "name=test

Re: [ansible-project] Re: add user via adhoc

2017-08-24 Thread Kai Stian Olstad
On torsdag 24. august 2017 21.51.02 CEST Tcpip wrote: > more /etc/ansible/hosts > [all:vars] > ansible_connection=local And here we have the reason. Here you say, all host should use ansible_connection=local aka run all task on all host on localhost. Remove that line and it will work as

[ansible-project] Re: add user via adhoc

2017-08-24 Thread Tcpip
more /etc/ansible/hosts [all:vars] ansible_connection=local username=admin password=admin [defaults] host_key_checking = False [router] SW-LAB001 ansible_host=10.1.99.120 [linux] pod1 ansible_host=10.1.108.105 pod2 ansible_host=10.1.108.128 pod3 ansible_host=10.1.108.132 pod4

Re: [ansible-project] Re: add user via adhoc

2017-08-24 Thread Kai Stian Olstad
On torsdag 24. august 2017 19.40.09 CEST Tcpip wrote: > @Kai > > how can I fix the issue? I guess you did not understand what I wrote in my previous mail. It's obviously an error in your configuration, so you need to post your inventory file, without it this will be a guessing game and that is

[ansible-project] Re: nesting of inventory file and include mechanisms

2017-08-24 Thread Narahari 'n' Savitha
Thank you Soniya for that clarification. The setup we have is that we have mutliple staging env's. Between staging environments we have some shared servers. Example apache is shared between SE1 (stagin env 1) and SE2 I looked at the structure you have provided and I tried to setup the hosts for

[ansible-project] Re: add user via adhoc

2017-08-24 Thread Tcpip
@Kai how can I fix the issue? Thanks. On Thursday, August 24, 2017 at 12:09:55 AM UTC-3, Tcpip wrote: > > Hi all > > I want to add users via adhoc commands > > ansible all -m user -a "name=test password=test" -s -K > > but is not working ,please help. > > thanks. > -- You received this

[ansible-project] Re: adhoc only in local server

2017-08-24 Thread Tcpip
Hello Andrew, Thanks for the link but still the same issue. thanks On Thursday, August 24, 2017 at 2:13:33 PM UTC-3, Tcpip wrote: > > Hi all, > > Im working with adhoc commands but I can see that is only working in my > local server not doing the task in the remote server. > > Any ideas? > >

Re: [ansible-project] adhoc only in local server

2017-08-24 Thread Andrew Latham
Try http://lathama.com/post/ansible-one-liners for a start. On Thu, Aug 24, 2017 at 12:13 PM, Tcpip wrote: > Hi all, > > Im working with adhoc commands but I can see that is only working in my > local server not doing the task in the remote server. > > Any ideas? > >

[ansible-project] adhoc only in local server

2017-08-24 Thread Tcpip
Hi all, Im working with adhoc commands but I can see that is only working in my local server not doing the task in the remote server. Any ideas? thanks -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and

[ansible-project] Re: Parsing log files with timestamp Ansible

2017-08-24 Thread SARANYA devotional R
I want to find the recently created file under a folder and cat to the file for the contents updates which can be visible while running a play in output. On Wednesday, 23 August 2017 03:29:19 UTC-4, Soniya panwar wrote: > > you can use lineinfile module for this. > > for more understanding on

[ansible-project] Conditionally running a filter in a chain

2017-08-24 Thread Jean-Francois Bibeau
Hi, Trying to do the following, and struggling to find a way to do this. I build a list of strings, and want to conditionally append a string at the end of the list, but only if the variable is defined. This works fine: play_hosts | union([optional_ip]) Which appends optional_ip to

Re: [ansible-project] flush_handlers do not... flush handlers?

2017-08-24 Thread Tom De Blende
OK, let me answer my own question. Despite what I read on Google (don't trust Google too much), one can use certain variables in a handler name. So it is pretty easy! Just add the variable in the notify section and the name of the handler. On Thu, Aug 24, 2017 at 3:32 PM, Tom De Blende

[ansible-project] flush_handlers do not... flush handlers?

2017-08-24 Thread Tom De Blende
Hi all, I have a playbook with different role sections. Each section runs the same role, but with different variables. Now if one role signals a handler to restart a service with a variable name, only the first service is restarted. Let me explain: This is the handler: - name: restart

[ansible-project] Re: nesting of inventory file and include mechanisms

2017-08-24 Thread Soniya panwar
hello, it will be easy to understand if you elaborate what exactly error you are getting. >> playbooks it works but for inventory, I am not sure how to do it Yes you are right it will work for playbooks but not for inventories. if you have multiple inventories file then you have to put all

[ansible-project] Re: nesting of inventory file and include mechanisms

2017-08-24 Thread Narahari 'n' Savitha
Thank you Soniya for you time and pointer. I tried this, but I am not able to make it work for inventory. playbooks it works but for inventory, I am not sure how to do it -N On Wednesday, August 23, 2017 at 12:51:22 AM UTC-4, Soniya panwar wrote: > > yes you can consider this. > but you have

Re: [ansible-project] Ansible-container build is failing with Permissions error

2017-08-24 Thread Kai Stian Olstad
On torsdag 24. august 2017 14.36.16 CEST ManiGandan T wrote: > I have been working on nodejs application installation through > ansible-container. Ansible-container mallinglist might be a better choice https://docs.ansible.com/ansible-container/community/index.html#i-ve-got-a-question -- Kai

[ansible-project] Ansible-container build is failing with Permissions error

2017-08-24 Thread ManiGandan T
Hi Team, I have been working on nodejs application installation through ansible-container. I have configured all the code in container and main.yml. While i test run the ansible-container --debug build command , i am facing the below error. Please help me on resolving the error : File

[ansible-project] Re: Win custom modules don't work after update to 2.3.1/2.3.2. How to proceed?

2017-08-24 Thread bernard . landon
Thanks for your answer! I will have another look soon. It's a bit annoying that modules that were working just fine won't work at all after an update of a minor version. And also to find no information about wether the way we create module changed or not. This being said, I do appreciate that

Re: [ansible-project] Re: add user via adhoc

2017-08-24 Thread Juraj Papic
Hello But I was testing but I can't see the home user. I was also trying to do copy files I have a successful out put but is not copying any file. Thanks in advance El 24/8/2017 07:16, "Soniya panwar" escribió: > hey, > the problem may be is in your password

Re: [ansible-project] Re: add user via adhoc

2017-08-24 Thread Kai Stian Olstad
On torsdag 24. august 2017 12.07.39 CEST Juraj Papic wrote: > That Will be in my host file what change should I do to make this work? It will be in your inventory. It would be easier if you could show us the entries for those two hosts, but I guess you have ansible_connection=local, just remove

Re: [ansible-project] Re: add user via adhoc

2017-08-24 Thread Daniel JD
ansible all -i hostfile -m user -a "name=test password=test" -s -K or ansible all -i 192.168.11.11, -m user -a "name=test password=test" -s -K there must be a comma after the ip because its a tuple. Am Donnerstag, 24. August 2017 12:07:53 UTC+2 schrieb Tcpip: > > That Will be in my host file

[ansible-project] Re: add user via adhoc

2017-08-24 Thread Soniya panwar
hey, the problem may be is in your password generation, may be your user has been created without password you can check that by these commands: user has been created but without password: # id test uid=229(test) gid=1(test) # grep -q test /etc/security/passwd && echo "password OK" || echo "NO

Re: [ansible-project] Re: add user via adhoc

2017-08-24 Thread Juraj Papic
That Will be in my host file what change should I do to make this work? Thanks El 24/8/2017 06:47, "Kai Stian Olstad" escribió: > On torsdag 24. august 2017 10.03.02 CEST Tcpip wrote: > > <172.22.15.3> ESTABLISH LOCAL CONNECTION FOR USER: root > > <172.22.14.3>

Re: [ansible-project] Install and use Ansible with a non-root account

2017-08-24 Thread Dick Visser
On 23 August 2017 at 22:59, Joaquin Tejada wrote: > Hello everyone. I need a little help. I've been looking for a document > that states or indicates what type of user access is required to install and > use Ansible. Can anyone point me to that direction? If you need

Re: [ansible-project] Re: add user via adhoc

2017-08-24 Thread Kai Stian Olstad
On torsdag 24. august 2017 10.03.02 CEST Tcpip wrote: > <172.22.15.3> ESTABLISH LOCAL CONNECTION FOR USER: root > <172.22.14.3> ESTABLISH LOCAL CONNECTION FOR USER: root This two lines in your log indicate you are using connection=local so everything run on localhost and not on the remote host.

[ansible-project] Re: add user via adhoc

2017-08-24 Thread Tcpip
firt I try to login with the user/pass and is not working then I just do more /etc/password thanks. On Thursday, August 24, 2017 at 12:09:55 AM UTC-3, Tcpip wrote: > > Hi all > > I want to add users via adhoc commands > > ansible all -m user -a "name=test password=test" -s -K > > but is not

[ansible-project] Re: add user via adhoc

2017-08-24 Thread Soniya panwar
how r u verifying that user is created or not? can you please share your command from which you are verifying and also the output of # grep test /etc/passwd. On Thursday, August 24, 2017 at 2:25:14 PM UTC+5:30, Tcpip wrote: > > Hello, > Yes the logs says that but when I check the remote server

[ansible-project] Re: add user via adhoc

2017-08-24 Thread Tcpip
Hello, Yes the logs says that but when I check the remote server nothing is created- thanks.!! On Thursday, August 24, 2017 at 12:09:55 AM UTC-3, Tcpip wrote: > > Hi all > > I want to add users via adhoc commands > > ansible all -m user -a "name=test password=test" -s -K > > but is not working

[ansible-project] Re: add user via adhoc

2017-08-24 Thread Soniya panwar
These logs shows that your user is created successfully. if you are not able to check the user whether it is created or not than you can see the output of this command # grep test /etc/passwd output of this command should be like this: test:x:1001:1001::/home/test: And if any query please

Re: [ansible-project] debugging nested list

2017-08-24 Thread Pshem Kowalczyk
Your 'packages1' is a dictionary/hash not a list/array, so if you want to iterate over it you have to use with_dict. kind regards Pshem On Thu, 24 Aug 2017 at 14:07 Henry Medina wrote: > Hello Folks, > > > I have a debugging question that has left me scratching my

[ansible-project] Re: add user via adhoc

2017-08-24 Thread Tcpip
Hello Soniya, This is the output I have and for what I can see none of my adhoc commands are working. Servers ubuntu 14.04 ansible 2.3.1.0 python version = 2.7.6 Thanks! This is the output I have Loading callback plugin minimal of type stdout, v2.0 from

[ansible-project] Re: sudoers.d file with template and validate is failing

2017-08-24 Thread Tyler K
Welp, I think the issue was related to my editor. I was using pycharm. It must have formatted the file somehow, cause I deleted the file then opened it in vim and pasted the same line. It worked On Thursday, August 24, 2017 at 12:58:03 AM UTC-5, Tyler K wrote: > > I have a task that is supposed