[ansible-project] Combine 2 dictionary in ansible / jinja2 (simple)

2020-04-17 Thread Tom Cheung
Hi friends, I want to use ansible to merge below 2 dictionary to become 1. I have been stucking for few days already. Headache. I have 2 variables now. *1. variable "my_directories":* { "directoryA": [ "/bar/foo/file1.txt", "/bar/foo/file2.txt" ], "directoryB": [

[ansible-project] Try to put 1 Ansible facts from multiple servers into one list

2020-04-17 Thread Gregory Skelton
I feel this should be easy. I'm trying to put a fact I set on each server into one central list. sat_id is the Big List sat_id_raw is the variable that I set earlier in the automation. What am I missing here? Thanks in advance name: Put all of the var into a big list set_fact:

[ansible-project] how to use suexec su in ansible

2020-04-17 Thread Pradeep Tiwari
Hi All, I did look at various privilege escalation tools available but i dont see suexec listed there. Could you please guide me how to achieve this become method -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this

[ansible-project] Re: Ansible invoking aws_s3 windows host in block/rescue failed error which hard to understand

2020-04-17 Thread Jordan Borean
Read through that issue you linked and you will see it. -- 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+unsubscr...@googlegroups.com. To view

Re: [ansible-project] Re: need to run powershell script without copying to target host

2020-04-17 Thread Pavan Nr
Thanks Jordan, very informative, I will try options which you mentioned. On Sat, 18 Apr, 2020, 12:53 AM Jordan Borean, wrote: > The proper way is to use the script module > > - name: run script > script: test.ps1 > > It will automatically try and find 'test.ps1' in various folder, the files >

[ansible-project] Re: Ansible invoking aws_s3 windows host in block/rescue failed error which hard to understand

2020-04-17 Thread Meir Yanovich
ok i found this question that has been ask before https://github.com/ansible/ansible/issues/34135 can you point me to some example using downloading the backet localy and then copy it to windows ? On Friday, April 17, 2020 at 9:51:56 PM UTC+3, Jordan Borean wrote: > > You can’t run Python

[ansible-project] Re: Ansible invoking aws_s3 windows host in block/rescue failed error which hard to understand

2020-04-17 Thread Jordan Borean
Because get_url is also a Python module https://docs.ansible.com/ansible/latest/user_guide/windows_faq.html#can-i-run-python-modules-on-windows-hosts. The alternative for you is to either use win_get_url, or download the file on the controller using the Python modules and use win_copy to copy

[ansible-project] Re: Ansible invoking aws_s3 windows host in block/rescue failed error which hard to understand

2020-04-17 Thread Meir Yanovich
also why the fall back dosn't work ? why does't it download from the web i mean the rescue block. On Friday, April 17, 2020 at 10:22:18 PM UTC+3, Meir Yanovich wrote: > > didn't know that , > How do i connect to s3 and download file using user/password ? > > > On Friday, April 17, 2020 at

[ansible-project] Re: need to run powershell script without copying to target host

2020-04-17 Thread Jordan Borean
The proper way is to use the script module - name: run script script: test.ps1 It will automatically try and find 'test.ps1' in various folder, the files folder adjacent to the playbook is one of them, copy it across, execute, then delete the file all in 1 go. If you truly don't want to copy

[ansible-project] Re: Ansible invoking aws_s3 windows host in block/rescue failed error which hard to understand

2020-04-17 Thread Meir Yanovich
didn't know that , How do i connect to s3 and download file using user/password ? On Friday, April 17, 2020 at 9:51:56 PM UTC+3, Jordan Borean wrote: > > You can’t run Python modules on Windows so this was never designed to work > on those hosts. -- You received this message because you are

[ansible-project] Ansible Permissions issues

2020-04-17 Thread George James
In the below playbook, I specify that ansible should run with the nginx user, but at the end when the task is run and I check in the process, I see that the last process runs with root. Also, when I try to override this by adding become nginx on that last user, the scripts stops working and

[ansible-project] Ansible invoking aws_s3 windows host in block/rescue failed error which hard to understand

2020-04-17 Thread Jordan Borean
You can’t run Python modules on Windows so this was never designed to work on those hosts. -- 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] New Ansible releases 2.9.7, 2.8.11, and 2.7.17 [Revised]

2020-04-17 Thread Matt Clay
This is an updated version of the original release announcement. It has been updated to include CVE details in the "What's new" section. Hi all- we're happy to announce that the general release of Ansible 2.9.7, 2.8.11, and 2.7.17 are now available! How do you get it? -- $ pip

[ansible-project] Ansible running script with wrong user

2020-04-17 Thread George James
I have the below task in ansible, but when I take a look at the process using `ps aux | grep nginx`, I see that the process is being run by the root user instead of the nginx user is there a way I can fix this. - name: Install Nginx Ubuntu hosts: all remote_user: "{{ NGINX_USER }}" become: yes

[ansible-project] need to run powershell script without copying to target host

2020-04-17 Thread Pavan Nr
Hi All, i have machien Ansible running in RHEL 7 Target host: Windows server 2019 i was able run powershell script by copying from RHEL to windows ,working fine - name: Copy a single file win_copy: src: "{{ playbook_dir }}/files/test.ps1" dest: C:\Temp\test.ps1 - name: Run

Re: [ansible-project] Re: [HOSTVARS][MERGED] Unexpected behavior with merge variables of different host which are in several groups

2020-04-17 Thread Stefan Hornburg (Racke)
On 4/17/20 4:54 PM, Baptiste Doublet wrote: > Hi, > > That did the job: > etcd_cluster: # recommendation: 3 or 5-7 nodes >       hosts: >         demo_postgres1: >             etcd_ip: '***' > > I don't know why I used vars, maybe because I read a lot of ansible > documentation like How to

[ansible-project] Re: [HOSTVARS][MERGED] Unexpected behavior with merge variables of different host which are in several groups

2020-04-17 Thread Baptiste Doublet
Hi, That did the job: etcd_cluster: # recommendation: 3 or 5-7 nodes hosts: demo_postgres1: etcd_ip: '***' I don't know why I used vars, maybe because I read a lot of ansible documentation like How to build your inventory and that cursed my brain ^^ atlanta:

[ansible-project] Loop functionality is failing when i use add_host module inventory in other playbook

2020-04-17 Thread Suresh Karpurapu
Hi Ansible team, I am using the CSV file as below for nfs volume migration as we have 1000 servers with 100 volumes. Hence, i would like to make to host inventory using add_host file instead using inventory file. However, the loop is failing when i use add_host module, if the server has more

Re: [ansible-project] REST API to add host to inventory for Ansible Tower is Not working!

2020-04-17 Thread Stefan Hornburg (Racke)
On 4/17/20 3:40 PM, Vivek Mandal wrote: > Hi, >I have been trying to execute a REST API to > Add a host to an inventory.Below is the API. > > /api/v2/inventories/{id}/hosts/ > > Unfortunately, This API doesn't work. It gives the response as 200(Ok). But > only displays the existing host.

[ansible-project] REST API to add host to inventory for Ansible Tower is Not working!

2020-04-17 Thread Vivek Mandal
Hi, I have been trying to execute a REST API to Add a host to an inventory.Below is the API. /api/v2/inventories/{id}/hosts/ Unfortunately, This API doesn't work. It gives the response as 200(Ok). But only displays the existing host. Its the same response when you run GET method for the

[ansible-project] Aruba_command no output to my Bash

2020-04-17 Thread 'Mac' via Ansible Project
Hi As a newbie to Ansible i have simple question for my understanding , if do a "show version" via a Playbook on any Network device i will get the output to the bash is started the playbook right ? for Example i to a ~# ansible-playbook play.yml -i /etc/ansible/hosts PLAY [aruba_ap]

[ansible-project] Re: vpshere: how to change port group for 2nd NIC on VM via ansible

2020-04-17 Thread JerryB
Hi Maybe this module will fix this: https://docs.ansible.com/ansible/latest/modules/vmware_guest_network_module.html Regards Jerry On Monday, September 24, 2018 at 1:10:03 PM UTC+2, Ansible Madness wrote: > > So seems the vmware_guest module is in fact ok - however there appears to > be no way

[ansible-project] Ansible invoking aws_s3 windows host in block/rescue failed error which hard to understand

2020-04-17 Thread Meir Yanovich
this block working fine in Linux ! i trying to use aws_s3 to download package and using fall back to download from web if its fail but im getting error which is hard to understand and pin point the couse of the error : i present only the prablematic code as it is pard of very big ansible

Re: [ansible-project] Re: query on ansible

2020-04-17 Thread mahesh g o
okay, so if i use them as tasks, will svm.yml takes aggr array from aggr.yml?? On Fri, Apr 17, 2020 at 4:42 PM Stefan Hornburg (Racke) wrote: > On 4/17/20 1:08 PM, mahesh g o wrote: > > > > I am newbie to ansiblei have to create many objects like >

Re: [ansible-project] Re: query on ansible

2020-04-17 Thread Stefan Hornburg (Racke)
On 4/17/20 1:08 PM, mahesh g o wrote: > > I am newbie to ansiblei have to create many objects like > this(aggr,svm,volumes,luns,policies,network interfaces) so > i have created playbook for each objects and thought of stitching it together. Yes it is good idea to split up tasks logically,

Re: [ansible-project] Re: query on ansible

2020-04-17 Thread mahesh g o
I am newbie to ansiblei have to create many objects like this(aggr,svm,volumes,luns,policies,network interfaces) so i have created playbook for each objects and thought of stitching it together. On Friday, 17 April 2020 16:29:18 UTC+5:30, Stefan Hornburg (Racke) wrote: > > On 4/17/20 12:55

Re: [ansible-project] Re: query on ansible

2020-04-17 Thread Stefan Hornburg (Racke)
On 4/17/20 12:55 PM, mahesh g o wrote: > Thank u very much ...it worked. > You are welcome. > I need one more helpthe aggr is coming from the playbook1. every time i > run that playbook1 individually and i enter > the aggr array in  playbook2. >  so how do i get the output of the 

[ansible-project] Re: query on ansible

2020-04-17 Thread mahesh g o
Thank u very much ...it worked. I need one more helpthe aggr is coming from the playbook1. every time i run that playbook1 individually and i enter the aggr array in playbook2. so how do i get the output of the playbook1 in the form of array so that i dont have to enter the aggr array in

Re: [ansible-project] Playbook to reboot the machine infinite times

2020-04-17 Thread Srinivas Naram
https://docs.ansible.com/ansible/latest/plugins/lookup/items.html On Fri, Apr 17, 2020 at 1:00 PM Pavan Nr wrote: > Hi Srinivas, > > i have not tried , can you share the links if possible. > > regards, > Pavan > > On Friday, April 17, 2020 at 11:15:49 AM UTC+5:30, Srinivas Naram wrote: >> >>

Re: [ansible-project] query on ansible

2020-04-17 Thread Stefan Hornburg (Racke)
On 4/17/20 10:54 AM, mahesh g o wrote: > I have below playbook: > > i have put a loop, there are 8 aggr and 4 protocols: this playbook output is > like after every 4 loop, it increments aggr > and protocols.  > > output of the playbook is: > > svm1,svm2,svm3,svm4---aggr1 and nfs >

[ansible-project] query on ansible

2020-04-17 Thread mahesh g o
I have below playbook: i have put a loop, there are 8 aggr and 4 protocols: this playbook output is like after every 4 loop, it increments aggr and protocols. output of the playbook is: svm1,svm2,svm3,svm4---aggr1 and nfs svm5,svm6,svm7,svm8---aggr2 and iscsi svm9,svm10,svm11,svm12---aggr3

Re: [ansible-project] Check status of VMware tools & reboot if VMware tools are not running

2020-04-17 Thread Abhijeet Kasurde
--- - hosts: localhost vars_files: - vcenter_vars.yml vars: vm_list: - test01 tasks: - name: Get information about the virtual machine vmware_guest_info: validate_certs: False hostname: '{{ vcenter_hostname }}' username: '{{ vcenter_username }}' password: '{{ vcenter_password }}' folder:

Re: [ansible-project] yum repolist -v Output to Vars/Dict and use the data

2020-04-17 Thread 'Spoonless' via Ansible Project
Hi, Thanks for the tip in the right direction: Here is what I have so far.. But, my Debug output is showing me all of the repo's and not filtering. ? tasks: - name: Set the required enabled repo information as facts shell: "yum repolist -v | grep {{item}} | awk -F\": \" '{print $2}'"

Re: [ansible-project] Need help on json query call in ansible

2020-04-17 Thread Suresh Karpurapu
Can anyone help me on this request or please suggest if there any alternative solution for my requirement? Regards, Suresh On Thu, 16 Apr 2020, 4:10 pm Suresh Karpurapu, wrote: > Thanks Racke, it's working for if host has single volume but same is > failing if the host has multiple volumes.

Re: [ansible-project] yum repolist -v Output to Vars/Dict and use the data

2020-04-17 Thread 'Spoonless' via Ansible Project
Hi again, Thanks for the tip in the right direction: I now have this: tasks: - name: Set the required enabled repo information as facts shell: "yum repolist -v | grep {{item}} | awk -F\": \" '{print $2}'" with_items: - "Repo-id" - "Repo-updated" -

[ansible-project] Check status of VMware tools & reboot if VMware tools are not running

2020-04-17 Thread Kiran Kumar
Hi I need to check status of VMware tools on vms & if VMware tools are not running, then reboot the vm. I have below playbook which works fine to find vm name & VMware tools status. Please help on how can i extract the vm name & take action as per status. Note : i have to use the VMware

Re: [ansible-project] Playbook to reboot the machine infinite times

2020-04-17 Thread Pavan Nr
Hi Srinivas, i have not tried , can you share the links if possible. regards, Pavan On Friday, April 17, 2020 at 11:15:49 AM UTC+5:30, Srinivas Naram wrote: > > Did you try using items ? > > On Fri, Apr 17, 2020 at 11:07 AM Pavan Nr > > wrote: > >> Hi, >> >> Need help to create playbook,

Re: [ansible-project] Playbook to reboot the machine infinite times

2020-04-17 Thread Pavan Nr
Hi Srinivas, i have not share , can you share the links is possible. regards, Pavan On Friday, April 17, 2020 at 11:15:49 AM UTC+5:30, Srinivas Naram wrote: > > Did you try using items ? > > On Fri, Apr 17, 2020 at 11:07 AM Pavan Nr > > wrote: > >> Hi, >> >> Need help to create playbook,

[ansible-project] Can I know if someone use network_cli as connection type for fortigate firewall automation.

2020-04-17 Thread Venu Devannagari
Hi, Actually I am trying to do use cli_command module to fortigate firewall but ansible says ansible_network_os type is not supported.I need some help to know is there any possibility to do fortigate through cli commands. Thanks in Advance. -- You received this message because you are