[ansible-project] Re: Ansible Training India

2017-01-18 Thread Brian Coca
I believe you can find that here: https://www.redhat.com/en/services/training/do407-automation-ansible -- 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] Strage behaviour related to localhost in ansible 2.2

2017-01-18 Thread Brian Coca
Ansible creates an implicit localhost when it is used, but not defined in inventory. The implicit localhost sets connection to 'local', among other things. When you define localhost, it inherits the default connection type ('smart/ssh' unless you changed config), so you need to either define the

Re: [ansible-project] New FreeBSD install seems modules are not found

2017-01-18 Thread Brian Coca
Not an installation issue, its indentation and task definition issues. The - indicates item, in this case a task, but task items must be indented inside a task: or as part of a role. The other issue is that a task requires an action, name is a property of a task and should always be in the same

Re: [ansible-project] ios_config module questions

2017-01-18 Thread Peter Sprygada
Hi Stijn: For the host argument use the following syntax: host: "{{ inventory_hostname }}" That will replace the value for host based on the node defined in inventory. For the using the env var you need to set that in your shell environment, not the inventory file. If you want to keep the

Re: [ansible-project] ios_command does not seem to be working

2017-01-18 Thread Peter Sprygada
What version of Ansible are you running? On Wed, Jan 18, 2017 at 4:05 PM, Mohamed Lrhazi wrote: > Hello, > > am trying ansible and ios_command module for the first time... it seems as > if ansible is trying to execute normal unix commands instead of ios... what > am I missing?

[ansible-project] Re: how to access variables set on target env

2017-01-18 Thread Rui Alves
Hi, The shell variables set in the setWLSEnv.sh are not persisted between ansible tasks. You can try execute both scripts in the same shell: - shell: source /setWLSEnv.sh && java weblogic.WLST {{ python file }} Regards, Rui Alves On Tuesday, January 17, 2017 at 9:06:34 PM UTC, Anand Dasari

[ansible-project] EC2 compound tags and limiting dynamic inventory

2017-01-18 Thread Bass Slap
I'm using ec2.py dynamic inventory successfully with limiting by *multiple tags*, but my need is to be able to limit by a tag where *one* of the compound values matches, but I haven't found a way to do so yet. Example: Tag = Apps Compound value = app1|app2|app3|app4 I'm kicking this off

[ansible-project] ios_command does not seem to be working

2017-01-18 Thread Mohamed Lrhazi
Hello, am trying ansible and ios_command module for the first time... it seems as if ansible is trying to execute normal unix commands instead of ios... what am I missing? ➜ cisco cat pb.yaml --- - hosts: ios gather_facts: no connection: local tasks: - name: RUN 'SHOW VERSION'

[ansible-project] Newlines are escaped when using jinja2 filters in playbook

2017-01-18 Thread Fredrik Rambris
I'm trying to get around the issue with authorized_keys not having support for exclusive and with_items. I have a list of keys I want to populate an authorized_keys file and have ansible remove all others that may be in the file. authorized_keys accepts a list of keys if they are supplied as a

[ansible-project] ios_config module questions

2017-01-18 Thread Stijn Vrijdag
Hey everyone, I'm giving Ansible a try and I'm quite impressed. I have a couple of questions regarding the ios_config module. --- - name: Configure ACL hosts: routers gather_facts: false connection: local tasks: - name: load new acl into device ios_config: host:

[ansible-project] docker_login and docker_service can't find docker-py when docker pip package is installed?

2017-01-18 Thread Gerald Spencer
*Playbook:* --- - name: hosts: linux tasks: - name: Ensure host is logged into dockerhub become: true docker_login: username: password: email: *Hosts pip output:* pip freeze | grep docker docker==2.0.1 docker-compose==1.10.0

[ansible-project] Ansible Training India

2017-01-18 Thread Jagadishan Perumal
Hello, Is there anyone in India who can provide ansible training. -- 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] Starting out with Ansible and Vagrant.

2017-01-18 Thread Pangaea Agartha
Hi Everyone. I am a complete noob to this so please be patient with me. I'm trying to learn Devops and my mentor asked me to research and attempt to get a vagrant machine online with a LEMP stack using only ansible to configure the machine. I am completely confused where to start with this.

[ansible-project] Strage behaviour related to localhost in ansible 2.2

2017-01-18 Thread Stefan Magnus Landrø
Hi all, Can anyone explain why targeting localhost explicitly instead of defaulting to localhost behaves differently? Cheers, Stefan -- ☁ deploy [master] ⚡ cat deploy_ping.yaml - hosts: localhost gather_facts: false max_fail_percentage: 0 strategy: free tasks: -

[ansible-project] Idempotency: How to determine which user to use when root is no longer allowed?

2017-01-18 Thread Johannes Kastl
Hi there, say I get a new instance somewhere that allows logins as root. I want to run a playbook that configures the machine and no longer allows root logins. And I want it to be idempotent. ;-) Consider this mock-up playbook: - hosts: foobar vars: ansible_user: root

Re: [ansible-project] Re: Getting Error while executing Commands having space in command module and shell module

2017-01-18 Thread Johannes Kastl
On 18.01.17 13:46 sgamp...@criterionnetworks.com wrote: > This 'ok' means 'onos-karaf', When I execute 'ok > clean' in my remote VM which is having onos installed in it. I There is your problem. I guess you have some kind of alias in your VM that lets you use ok without errors. Ansible does not

[ansible-project] How to use ansible with active directory

2017-01-18 Thread challa . tek
Do we have any module in ansible that we can use to add users and groups to AD. -- 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] Execute windows batch file which called another batch file

2017-01-18 Thread Gad
Hi Im tryin to execute "c:\my files\a.bat" which call : "c:\my files\c.bat" i did try using the raw module like: raw: "cd \"c:\my-files\" & \"c:\my-files\a.bat\"" but ansible refuse to pipe the sign & also tried with \"&\" but then error appears how can i cd to a relevant directory and then

[ansible-project] Re: Var substitution help

2017-01-18 Thread Dimitri Yioulos
Thank you, Kai! Works fine now. On Wednesday, January 18, 2017 at 9:12:27 AM UTC-5, Dimitri Yioulos wrote: > > Hello, all. > > A while ago, I created a quck-'n-dirty user creation playbook. With the > following line, I was able to both create the user, and his/her encrypted > password (for

Re: [ansible-project] Var substitution help

2017-01-18 Thread Kai Stian Olstad
On 18. jan. 2017 15:12, Dimitri Yioulos wrote: tasks: - name: create user in Centos 6 user: name={{ user }} password={{ '{{ password }}'|password_hash('sha512', 'ies8Aech') }} state=present With the above, while the user is created, the password doesn't work. Help would be appreciated.

Re: [ansible-project] What is the difference between inventory group_vars and playbook group_vars?

2017-01-18 Thread Brian Coca
Depends on what they are adjacent to, inventory or play. If you only use one the distinction is mostly irrelevant.​ -- 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

[ansible-project] Var substitution help

2017-01-18 Thread Dimitri Yioulos
Hello, all. A while ago, I created a quck-'n-dirty user creation playbook. With the following line, I was able to both create the user, and his/her encrypted password (for CentOS 6/7): user: name="someuser" password={{ 'somepassword'|password_hash('sha512', 'mSFRM"N4') }} state=present Now,

[ansible-project] What is the difference between inventory group_vars and playbook group_vars?

2017-01-18 Thread Cev Ing
The following document http://docs.ansible.com/ansible/playbooks_variables.html#variable-precedence-where-should-i-put-a-variable states that inventory group_vars have lower precedence than playbook group_vars. But I have just one group_vars directory in my installation. When I put anything

[ansible-project] Re: Getting Error while executing Commands having space in command module and shell module

2017-01-18 Thread sgampawa
Hi Johannes, This 'ok' means 'onos-karaf', When I execute 'ok clean' in my remote VM which is having onos installed in it. It used to run clean up Job and runs the new session of onos. In short it used to run onos controller installed in remote machine. Please consider this example

[ansible-project] Conditional broken with Ansible 2.2.1.0-1 running on Rhel6/CentOS6

2017-01-18 Thread Philippe Eveque
Hello The ansible 2.2.1.0-1 running on Rhel6/CentOS6 leads to error for existing playbooks with roles applied conditionally. The fix is available in the stable-2.2 branch (and others) We have numerous playbooks based on the conditional role execution When can we expect a 2.2.1.0-2 version -

Re: [ansible-project] Re: Getting Error while executing Commands having space in command module and shell module

2017-01-18 Thread Johannes Kastl
Hi there, On 18.01.17 12:49 sgamp...@criterionnetworks.com wrote: > tasks: - name: running ok clean command: ok clean What kind of command is 'ok'? Is this your actual executable? In your previous examples I assumed it was called 'onos'. > "[Errno 2] No such file or directory", "rc": 2} Your

[ansible-project] Re: Getting Error while executing Commands having space in command module and shell module

2017-01-18 Thread sgampawa
Hi Johannes, As you can see in latest post I ran playbooks by adding quotes in it, But still I getting error. Do you have any idea why I am getting this error ? Is that I am missing something ? - shubham On Tuesday, January 17, 2017 at 4:07:35 PM UTC+5:30,

[ansible-project] Re: Find module questions

2017-01-18 Thread Reji
Brian, Thanks for your help. It works. Much appreciated. --- On Monday, January 16, 2017 at 11:51:33 AM UTC-5, Reji wrote: > > I am using Ansible 2.2 and I am running into issues when using the "find" > module. My intention is to check for a pattern in a remote host file. >

[ansible-project] Re: Getting Error while executing Commands having space in command module and shell module

2017-01-18 Thread sgampawa
Yes Dick, I tried that way as well still I am getting same error as you can see my playbook playbook: --- - hosts: atrium gather_facts: no tasks: - name: running ok clean command: ok clean chdir=/home/admin/onos warn=no register: result - debug:

Re: [ansible-project] Send playbook output to Logstash/Elasticsearch

2017-01-18 Thread dubravko sever
Hi, Using given callback I'm able to log events from ansible to logstash/elastic search. But can't search ansible_result field because it represent field as string, for instance: "{"changed":"false", "msg":"some message"}". In ELK I'm trying to get format like this one "ansible_result":{

Re: [ansible-project] Run multiple tasks with different Ansible users for Windows hosts

2017-01-18 Thread Johannes Kastl
On 13.01.17 11:43 davidfof wrote: > ansible-playbook --limit windows -i hosts --extra-vars > "ansible_user=my_username ansible_password=my_password" site.yaml > - include: task_for_other_windows_user.yml vars: ansible_user: > "{{other_windows_user_name}}" ansible_password: >

Re: [ansible-project] Variables from csv and loops with random records

2017-01-18 Thread Johannes Kastl
On 17.01.17 09:42 Mátyás Kovács wrote: > I hope you can help me with this problem. There are 50 different > servers, each of them has different iptables firewall and rules. I > want them to be managed by Ansible. My idea is to create a csv > file, like this: Have a look at

Re: [ansible-project] how to access variables set on target env

2017-01-18 Thread Johannes Kastl
On 18.01.17 09:34 Dick Visser wrote: > You can define environment variables for a task: > http://docs.ansible.com/ansible/playbooks_environment.html > > If that setWLSEnv.sh contains many vars then store all of them in > one ansible var for easy reuse and less clutter. I would suggest setting

Re: [ansible-project] Getting Error while executing Commands having space in command module and shell module

2017-01-18 Thread Johannes Kastl
On 18.01.17 09:17 Dick Visser wrote: > You seem to be specifying a parameter as the command? > As per examples specify the actual command first, and then put the > parameters after that. > Preferably on different lines to make it more readable. Also, as soon as spaces are involved, trying to

Re: [ansible-project] Variables from csv and loops with random records

2017-01-18 Thread Kai Stian Olstad
On 17.01.2017 09:42, Mátyás Kovács wrote: Hi All, I hope you can help me with this problem. There are 50 different servers, each of them has different iptables firewall and rules. I want them to be managed by Ansible. My idea is to create a csv file, like this: I highly recommend against a

Re: [ansible-project] how to access variables set on target env

2017-01-18 Thread Dick Visser
Each task has its own environment, so what your setting by running a shell script is lost afterwards, hence your error. You can define environment variables for a task: http://docs.ansible.com/ansible/playbooks_environment.html If that setWLSEnv.sh contains many vars then store all of them in

Re: [ansible-project] Getting Error while executing Commands having space in command module and shell module

2017-01-18 Thread Dick Visser
You seem to be specifying a parameter as the command? As per examples specify the actual command first, and then put the parameters after that. Preferably on different lines to make it more readable. http://docs.ansible.com/ansible/command_module.html#examples Dick On Tue, 17 Jan 2017 at