Re: [ansible-project] Multiple values in variable

2019-11-14 Thread Pierre Ochsenbein
Hi Vladimir, Thanks a lot !!! It was what I want with the mount point! My question was, how I can manage 3 variables in a loop? for example the chown file (path, user and group variable) have a great day Le mer. 13 nov. 2019 à 21:19, Vladimir Botka a écrit : > On Wed, 13 Nov 2019 19:03:3

Re: [ansible-project] Multiple values in variable

2019-11-14 Thread Vladimir Botka
On Thu, 14 Nov 2019 10:15:09 +0100 Pierre Ochsenbein wrote: > My question was, how I can manage 3 variables in a loop? for example the > chown file (path, user and group variable) Let's create a list of dictionaries and loop the list. For example vars: my_files: - path: /scrat

[ansible-project] AWS Ansible Python Boto - Profile Not Found Error

2019-11-14 Thread kingston vedanayagam
Hi All, I have a simple playbook to create an EC2 instance in my account which is failing with "ProfileNotFoundError" when runs. > [root@ansibleserver ~]# cat /etc/system-release CentOS Linux release 7.6.1810 (Core) [root@ansibleserver ~]# ansible --version ansible 2.4.2.0 config file = /etc/

Re: [ansible-project] Need to Extract data from the Ansible debug out put

2019-11-14 Thread Rakesh Parida
Hi Jordan , Thanks for your suggestion . It worked for some extent , now iam getting the o/p as below. Actually i am new to PowerCLI so dont have much idea on PowerCLi cmdlets, But is there a way to remove the inverted commas and Comma using the PowerCLi Commad. "BVI12DS2", "BV

Re: [ansible-project] Need to Extract data from the Ansible debug out put

2019-11-14 Thread Rakesh Parida
Hi Abhijeet and Sam, Actually the Vcenter in my organisation has policy enforced not have SSL connectivity , so i cld nt use ansible vm-modules . That is why i had to switch to PWSH using ansible. Jordan's Suggestion worked . But i need to figure out how to remove special characters from o/p us

Re: [ansible-project] Need to Extract data from the Ansible debug out put

2019-11-14 Thread Rakesh Parida
Here is my script whcih i am using: Connect-VIServer -Server x.x.x.x -User:x.com\ -Password: | Out-Null $result = Get-VM -Name BV* |Where-object {$_.powerstate -eq "poweredon"} | Select-Object -ExpandProperty Name $result On Thursday, November 14, 2019 at 6:47:31 PM UTC+5:30, Rak

Re: [ansible-project] AWS Ansible Python Boto - Profile Not Found Error

2019-11-14 Thread RAVITZ
Try with aws_profile=profile-in-awsconfig ansible-playbook playbookname On Thu, Nov 14, 2019, 6:31 PM kingston vedanayagam < kingston2pok...@gmail.com> wrote: > Hi All, > > I have a simple playbook to create an EC2 instance in my account which is > failing with "ProfileNotFoundError" when runs. >

Re: [ansible-project] Need to Extract data from the Ansible debug out put

2019-11-14 Thread Vandana Thakur
If you want to remove “” via ansible , thats possible On Thu, 14 Nov 2019 at 18:53, Rakesh Parida wrote: > Here is my script whcih i am using: > > Connect-VIServer -Server x.x.x.x -User:x.com\ -Password: | > Out-Null > $result = Get-VM -Name BV* |Where-object {$_.powerstate -eq "pow

[ansible-project] Block and Rescue behavior question

2019-11-14 Thread Michael Cronenworth
Is a "rescue" in a "block" supposed to run at the very end of a play? The documentation and examples would lead you to believe that a rescue is supposed to happen immediately following a block failure. I am not seeing that behavior though. Example: - task_module_1: - block: - task_module_2:

Re: [ansible-project] Ansible can't access my network devices. Getting : FAILED! => {"changed": false, "msg": "Connection type ssh is not valid for this module"}

2019-11-14 Thread Sam Doran
Palmer, When connecting to network devices, you need to specify an appropriate connection plugin , such as network_cli, and specify the network OS

[ansible-project] Attaching files with the Ansible Jira module

2019-11-14 Thread Necati Karyeli
Hi, Does anyone has any experience with attaching files with the Ansible Jira module? I have tried the following but it returns HTTP Error 400 other operations like transition and comment are working fine - name: 'attachment Jira' local_action: module: jira uri: "{{jira URL}}" username: "{{{

Re: [ansible-project] Block and Rescue behavior question

2019-11-14 Thread Kai Stian Olstad
On Thu, Nov 14, 2019 at 07:15:48AM -0800, Michael Cronenworth wrote: > Is a "rescue" in a "block" supposed to run at the very end of a play? No. > The documentation and examples would lead you to believe that a rescue is > supposed to happen immediately following a block failure. That's correc

Re: [ansible-project] Block and Rescue behavior question

2019-11-14 Thread Sam Doran
Michael, That is correct: rescue tasks run immediately after the task that fails. I'm unable to duplicate the behavior you're seeing. --- Sam -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receivin

[ansible-project] debug vars

2019-11-14 Thread Pierre Ochsenbein
Dear all, I would like to have the nRam and nCPU of this following output. How I can sort this output with a var? The following content of my result: - debug: var: result.content ok: [localhost] => { "result.content": "\nId: 19171\nNom: LAB-001\nType: v

Re: [ansible-project] debug vars

2019-11-14 Thread Matt Martz
Something like this would probably work: '{{ result.content|regex_findall("(?m)^(?:RAM|CPU):\s+(\d+)") }}' That returns something like: ok: [localhost] => { "msg": [ "8192", "2" ] } If the result is unordered, you might need to remove the ?: before RAM, so that is includ

Re: [ansible-project] debug vars

2019-11-14 Thread Pierre Ochsenbein
Thanks a lot you rocks! How I can learn about this output? Yes it's better when I removed the ?: It's the same structure of this command if I want the nSite and the nSalle output? "content": "\nId: 47\nNom: THONON11\nType: virtuel\nOS: AIX 7200-0

[ansible-project] TimeOut

2019-11-14 Thread Marc-antoine Desrochers
Here's my problem: I have to make a playbook to execute on a large range of servers but those servers can go down anytime, i can lose connection at any moment so i need ansible to be able to failed the job when the server gets unreachable. Now when i execute a script on the remote server using

Re: [ansible-project] Block and Rescue behavior question

2019-11-14 Thread Michael Cronenworth
On Thursday, November 14, 2019 at 9:33:51 AM UTC-6, Sam Doran wrote: > > Michael, > > That is correct: rescue tasks run immediately after the task that fails. > I'm unable to duplicate the behavior you're seeing. > I've been able to reproduce it with a small test case. The issue is with multi

[ansible-project] What approach should I take with this loop?

2019-11-14 Thread John Harmon
The following fails for sure, but you get the idea of what I am trying to do. How might I be able to loop this? Problem is with 'searchme' and probably trying to do something you can't do - name: Set fact based on host set_fact: log_source: "{{ item.src }}" when: "ansible_hostname is s

Re: [ansible-project] What approach should I take with this loop?

2019-11-14 Thread Vladimir Botka
On Thu, 14 Nov 2019 11:41:51 -0800 (PST) John Harmon wrote: > The following fails for sure, but you get the idea of what I am trying to > do. How might I be able to loop this? Problem is with 'searchme' and > probably trying to do something you can't do > > - name: Set fact based on host >

Re: [ansible-project] What approach should I take with this loop?

2019-11-14 Thread John Harmon
On Thursday, November 14, 2019 at 1:59:18 PM UTC-7, Vladimir Botka wrote: > > On Thu, 14 Nov 2019 11:41:51 -0800 (PST) > John Harmon > wrote: > > > The following fails for sure, but you get the idea of what I am trying > to > > do. How might I be able to loop this? Problem is with 'searchme

[ansible-project] archive: "file.zip" does not exist

2019-11-14 Thread John Harmon
I have the following: - name: Compress reports archive: path: "{{ final_location }}/{{ host }}_reports" #dest: "{{ final_location }}/{{ host }}_reports.zip" format: zip It returns this: TASK [LookingGlass : Compress reports]

[ansible-project] Updated ansible failed on checks

2019-11-14 Thread 'Chris Bidwell - NOAA Federal' via Ansible Project
Hi all, After running ansible 2.9, I'm getting these errors: fatal: [jjohnson-lx]: FAILED! => {"msg": "The conditional check 'ansible_distribution_major_version | version_compare('6', '=')' failed. The error was: template error while templating string: no filter named 'version_compare'. String: {

Re: [ansible-project] Updated ansible failed on checks

2019-11-14 Thread Matt Martz
The syntax you are using was deprecated in Ansible 2.5 and should have been emitting a deprecation warning. See this doc for more info: https://docs.ansible.com/ansible/latest/porting_guides/porting_guide_2.5.html#jinja-tests-used-as-filters Effectively you need to change the `|` to `is` On Thu,

Re: [ansible-project] AWS Ansible Python Boto - Profile Not Found Error

2019-11-14 Thread kingston vedanayagam
Hi Ravi, Thanks for helping.. I am still getting the same error even after mentioned the profile name. [root@ansibleserver ~]# cat .aws/credentials [user1] aws_access_key_id = 6JO2WH2PH4Q aws_secret_access_key = Ky2laT9PwJSqBjDK5 [user2] aws_access_key_id = JOQNXRWYHM aws_secret_access_key = gK8

[ansible-project] Re: AWS Ansible Python Boto - Profile Not Found Error

2019-11-14 Thread kingston vedanayagam
Following command doesn't return any output. Is that fine? [root@ansibleserver ~]# python /usr/lib/python2.7/site-packages/ansible/module_utils/ec2.py --list --profile user2 [root@ansibleserver ~]# python /usr/lib/python2.7/site-packages/ansible/module_utils/ec2.py --list --profile user1 [root

[ansible-project] Re: Ansible can't access my network devices. Getting : FAILED! => {"changed": false, "msg": "Connection type ssh is not valid for this module"}

2019-11-14 Thread Palmer
Thanks for the input. I did try what you suggested but I'm here the same issue. Please take a look at the screenshot and let me know if you see something [image: ansserror.JPG] On Wednesday, November 13, 2019 at 11:35:32 PM UTC-5, Palmer wrote: > > Hi, > > I'm new to Ansible and trying to wr

[ansible-project] Re: Ansible can't access my network devices. Getting : FAILED! => {"changed": false, "msg": "Connection type ssh is not valid for this module"}

2019-11-14 Thread Scott Fella
I’m pretty new to and ran into the same issue. Is your hosts file defined like this: [ios] RTR1 RTR2 Did you define something in your config.yml? -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop recei

Re: [ansible-project] Re: AWS Ansible Python Boto - Profile Not Found Error

2019-11-14 Thread Dick Visser
You appear to have searched for (and found) a file called ec2.py in the ansible code tree. It’s part of the code and not meant to be run like that. If you intended to use the ec2.py dynamic inventory script, the docs are clear where to get that: https://docs.ansible.com/ansible/latest/user_guide/i

Re: [ansible-project] Updated ansible failed on checks

2019-11-14 Thread Vladimir Botka
On Thu, 14 Nov 2019 16:58:01 -0600 Matt Martz wrote: > The syntax you are using was deprecated in Ansible 2.5 and should have been > emitting a deprecation warning. See this doc for more info: > https://docs.ansible.com/ansible/latest/porting_guides/porting_guide_2.5.html#jinja-tests-used-as-filt