[ansible-project] Re: Ansible 2.4.2 Cacshing issue

2018-02-22 Thread Kernel V5
Solved On Friday, February 23, 2018 at 10:39:38 AM UTC+8, Kernel V5 wrote: > > > > I am using* Ansible 2.4.2. *I am not able to Switch AWS profile with > Ansible, it cached my profile information. Even I deleted .aws/credentials > file, its still working smoothly. > > Till now I already tried th

Re: [ansible-project] Ansible 2.4.2 Cacshing issue

2018-02-22 Thread ᴷᴲᴿᴺᴲᴸ
I Solve it :-) Sent with Mailtrack On Fri, Feb 23, 2018 at 10:40 AM Kernel V5 wrote: > > > I am using* Ansible 2.4.2. *I am not able to Switch AWS profile with > Ansible, it c

[ansible-project] Ansible 2.4.2 Cacshing issue

2018-02-22 Thread Kernel V5
I am using* Ansible 2.4.2. *I am not able to Switch AWS profile with Ansible, it cached my profile information. Even I deleted .aws/credentials file, its still working smoothly. Till now I already tried those solutions ansible-playbook --flush-cache gather facts: false. -- You receiv

[ansible-project] Ansible 2.5.0 Release Candidate 1 is available

2018-02-22 Thread mattdavi
Hi all- we're happy to announce that Release Candidate 1 of Ansible 2.5.0 is now available! How do you get it? -- All Ansible pre-releases in the 2.5 series will be published to PyPI. This is probably the easiest way for most

Re: [ansible-project] Multiple when statements in loop?

2018-02-22 Thread John Harmon
Right, I saw that I don't understand why in the example you gave you are referencing item.1.* and then using a when statement of item.0 On Thursday, February 22, 2018 at 4:55:59 PM UTC-7, Matt Martz wrote: > > It allows you to loop 2 parallel sets of data. > > See > http://docs.ansible.com/

Re: [ansible-project] Multiple when statements in loop?

2018-02-22 Thread Matt Martz
It allows you to loop 2 parallel sets of data. See http://docs.ansible.com/ansible/latest/playbooks_loops.html#looping-over-parallel-sets-of-data On Thu, Feb 22, 2018 at 5:24 PM, John Harmon wrote: > Thanks. with_together is new to me. I am having a hard time wrapping my > mind around the ex

[ansible-project] Re: Using new SSH password when running task

2018-02-22 Thread Cody Harlow
I should mention that I call the variable using hostvars['localhost']['varname']['json']['password']. On Thursday, February 22, 2018 at 6:54:31 PM UTC-5, Cody Harlow wrote: > > So I have a role that pulls a password from a website using the uri method > and I store it in a variable. I call the v

[ansible-project] Using new SSH password when running task

2018-02-22 Thread Cody Harlow
So I have a role that pulls a password from a website using the uri method and I store it in a variable. I call the variable like this: varname.json.password. How can I use this password when Ansible jumps to the next play? I tried setting ansible_user and ansible_ssh_pass as variables, and I c

Re: [ansible-project] Multiple when statements in loop?

2018-02-22 Thread John Harmon
I created the following playbook, and this works as expected, but I don't understand it in context to what you recommended: --- - hosts: localhost vars: x: ['a','b','c'] y: ['1','2','3'] z: ['first','second','third'] tasks: - name: Testing debug: msg="x is {{ item.0 }},

Re: [ansible-project] Multiple when statements in loop?

2018-02-22 Thread John Harmon
Thanks. with_together is new to me. I am having a hard time wrapping my mind around the example you gave. Can you explain it to me? On Thursday, February 22, 2018 at 3:40:31 PM UTC-7, Matt Martz wrote: > > I think instead of doing that, you should use `with_together` and a single > `when` sta

Re: [ansible-project] Multiple when statements in loop?

2018-02-22 Thread Matt Martz
I think instead of doing that, you should use `with_together` and a single `when` statement that meets your needs ... line: "{{ item.1.line }}" regexp: "{{ item1.regexp }}" ... when: item.0.stat.exists with_together: - "{{ directories.results }}" - - { line: '-w /home/GOM

[ansible-project] Multiple when statements in loop?

2018-02-22 Thread John Harmon
For reference, this is a continuation of: https://groups.google.com/forum/#!topic/ansible-project/XhU9iPXjjcw Can you use multiple when statements in a loop? or is there a different way to approach this without having to write out a task for each item? Take the following for example. I know t

[ansible-project] Re: Parsing var created with loop

2018-02-22 Thread John Harmon
Sorry, syntax error. Had stats not stat. On Thursday, February 22, 2018 at 3:03:44 PM UTC-7, John Harmon wrote: > > Thanks Kai. I still see a problem: > - name: debug > debug: > var: directories.results.0.stats.exists > > > > Result: > TASK [debug] > **

[ansible-project] Re: Parsing var created with loop

2018-02-22 Thread John Harmon
Thanks Kai. I still see a problem: - name: debug debug: var: directories.results.0.stats.exists Result: TASK [debug] ***

Re: [ansible-project] Firewall Rules Check with Ansible

2018-02-22 Thread Kai Stian Olstad
On Thursday, 22 February 2018 22.26.38 CET marcalfa1 wrote: > I have a firewall with about 50 rules and constantly growing. Is there a > way I can create a playbook to test whether a source host can connect to a > destination host on a specific port? > If that is possible I can create a playbook

Re: [ansible-project] Parsing var created with loop

2018-02-22 Thread Kai Stian Olstad
On Thursday, 22 February 2018 22.26.01 CET John Harmon wrote: > I have the following output from a variable called directories. It was > created using a loop that would run stat against two different paths. What > is the proper way to reference the "stat: exists: boolean" sections of the > out

[ansible-project] Ansible multiple roles in a block with rescue/fail

2018-02-22 Thread smitconsultant2017
Hi, I am trying to create a master playbook where I am including multiple roles in it. I am using block for each role in playbook along with rescue and fail section. Rescue section should perform rollback of the previous completed role and should fail playbook after rolling back and email fai

[ansible-project] Firewall Rules Check with Ansible

2018-02-22 Thread marcalfa1
I have a firewall with about 50 rules and constantly growing. Is there a way I can create a playbook to test whether a source host can connect to a destination host on a specific port? If that is possible I can create a playbook similar to my firewall rules so next time we make a change to the f

[ansible-project] Parsing var created with loop

2018-02-22 Thread John Harmon
I have the following output from a variable called directories. It was created using a loop that would run stat against two different paths. What is the proper way to reference the "stat: exists: boolean" sections of the output? I need to check for both directories for both item.paths. I hav

Re: [ansible-project] Ansible - use variable from another host

2018-02-22 Thread Brian Coca
hostvars requires a string that is a host name: hostvars[''] , if the 'windows' is a hostname you can do hostvars['windows']['varname'] .. if it is a group , you cannot do this, you need to use a specific hostname. But if you just want any host in the group you can do : hostvars[groups['windows'][

[ansible-project] Ansible - use variable from another host

2018-02-22 Thread Larry Bakun
I have a playbook that executes a script on a Windows box that returns a value that I have to re-use later on in my playbook after switching to the localhost. How can I access this value after switching back to localhost. Here is an example: hosts: localhost connection: local gather_facts: no

[ansible-project] Building an ansible job to run customized CLI configurations

2018-02-22 Thread Jonathan Umpleby
So, I'm new to ansible, and I'm hoping to find ways to meet a customize-able CLI deployment scenario, where 99% of the commands are the same across devices, but a handful will be unique. I was originally thinking about using a single response file would cover the 99% (in my example I'm trying t

Re: [ansible-project] Run multiple play books according to role

2018-02-22 Thread Brian Coca
you can have many plays per playbook or even include other playbooks in a playbook, not sure what your combinations above mean, but you should be able to adjust the hosts: keyword to whatever you want. -- -- Brian Coca -- You received this message because you are subscribed to the Goog

[ansible-project] Re: How to schedule an ansible job form a command line

2018-02-22 Thread timothy.n.mcgibbon via Ansible Project
I have found what I needed at http://docs.ansible.com/ansible-tower/latest/html/towerapi/launch_jobtemplate.html On Wednesday, February 21, 2018 at 11:29:49 AM UTC-6, Mcgibbon, Timothy N - Eagan, MN - Contractor wrote: > > What is the command line to have Ansible schedule a job template with >

[ansible-project] handlers and include_role, import_role

2018-02-22 Thread George Shuklin
I've done research on behaviour of handlers together with include/import role. https://medium.com/@george.shuklin/include-role-import-role-and-handlers-in-ansible-b32a5386a555 Short excerpt: |import_role|: All handlers are in the same scope, inner handlers always win. |include_role|: Handle

Re: [ansible-project] Run multiple play books according to role

2018-02-22 Thread Ansible Krazy
So what if I want to run playbook a,b,c if group a and c,d,e if group type is b can it be achieved via one combined playbook On Thu, Feb 22, 2018 at 12:53 AM, Brian Coca wrote: > Your roles sounds like 'other type of group', i.e webserver, dbserver, > just define those as groups in Ansible. and

[ansible-project] backing up a cisco device using telnet

2018-02-22 Thread 'Daley Okuwa' via Ansible Project
Is there any information that allows me to backup a cisco device using telnet rather than ssh as the device do not support SSH -- 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,

Re: [ansible-project] Can someone show a working example of how to iterate over the rows of a csv file?

2018-02-22 Thread Nico Sabbi
Sorry, but it's not clear at all how debug iterates over the rows. Running a simple debug doesn't help. For example, if I had a playbook like this (that of course doesn't work), how should I fix it to iterate over every single row and print the value of the 3 columns? --- - hosts: db bec

[ansible-project] Security acess to a machine via Ansible

2018-02-22 Thread Oscar Pinto
How can I ensure that a user that is used to play the playbooks does not have ssh access in any other way -- 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 a

[ansible-project] Virtual Box Installation on Windows Server 2012

2018-02-22 Thread SUMIT SAHAY
Hello Everyone, I want to install virtual box on window server 2012, I wrote one playbook here below for reference, --- - name: install vb hosts: winserver strategy: free gather_facts: false tasks: - win_package: path: 'C:\Path_of_file\VirtualBox-5.2.0-118431-Win.exe' #