Re: [ansible-project] Get file(s) from a remote host to local host

2019-09-18 Thread Brian Coca
Your issue is that Apps_files.files is a list, so Apps_files[0].path would access the path of the FIRST file in that list, which means you have to extract path for each item to make the fetch loop work: - name: fetch: src: "{{ item }}" dest: /APPADMIN/ansible/nonprod/DR_test/ loop:

Re: [ansible-project] Re: Can inventory plugin "constructed" create a groups based on ansible_facts

2019-09-18 Thread Brian Coca
yes, but you need to have facts already. This can be accomplished in 2 ways, 1) fact cache 2) meta: refresh_inventory after fact gathering -- -- Brian Coca -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this

[ansible-project] SLES 15 SP1: Install pip

2019-09-18 Thread Keith Mills
Hi All, I need to install pip and additional pip modules. Having trouble with virtualenv, it's not installing. What I have: - name: install pip easy_install: name: pip state: latest - name: install additional pip modules easy_install: name: virtualenv executable:

[ansible-project] Get file(s) from a remote host to local host

2019-09-18 Thread R-JRI
Hi, I created a simple yml file to get file or files from a remote host to local host: $ cat fetch.yml --- - hosts: serverA tasks: - name: find the files find: paths: /usr/local/apps/log patterns: AppsAdmin.*.ALLAPPS.20190828* use_regex: True register: Apps_files

[ansible-project] Re: root user password needs to set for many servers however the password should be different password, not to be same

2019-09-18 Thread Dan Linder
Great to hear! Thanks for the feedback. On Wednesday, September 18, 2019 at 11:18:03 AM UTC-5, Deepan M wrote: > > Thank you Dan Linder, playbook is working perfect. > > Regards, > Deepan M > > On Tuesday, September 17, 2019 at 10:06:25 PM UTC+5:30, Deepan M wrote: >> >> Hi, >> >> manually login

[ansible-project] Re: root user password needs to set for many servers however the password should be different password, not to be same

2019-09-18 Thread Deepan M
Thank you Dan Linder, playbook is working perfect. Regards, Deepan M On Tuesday, September 17, 2019 at 10:06:25 PM UTC+5:30, Deepan M wrote: > > Hi, > > manually login to each servers and setting root password, login to > server1, set password "password123" ; then login to server2 set >

Re: [ansible-project] Re: customs list of paths for searching templates?

2019-09-18 Thread Michael Ströder
On 9/17/19 9:09 AM, Soniya panwar wrote: As i understand your query you want to use custom list of jinja2 template paths. you can use fileglob module here to match all the files of a particular pattern in a directory. This module return a list of paths. Below is the example playbook: [..]    

[ansible-project] Re: error using "become"?

2019-09-18 Thread Mike Eggleston
Matt, thanks for your help. Mike -- 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 this discussion on

[ansible-project] Re: error using "become"?

2019-09-18 Thread Mike Eggleston
Sudo is too old. This works: --- - hosts: appsrv98 tasks: - name: test (1/2) command: uptime - name: test (2/2) command: uptime become: true become_flags: -H -S -- You received this message because you are subscribed to the Google Groups "Ansible Project"

Re: [ansible-project] Re: error using "become"?

2019-09-18 Thread Mike Eggleston
That's an interesting thought. Ansible isn't required on the remote machine; python is though. Here's on the remote machine: DEV App Server 98 appsrv98:meggle1:/home/meggle1> rpm -qi ansible package ansible is not installed DEV App Server 98 appsrv98:meggle1:/home/meggle1> python -V Python 2.7.16

Re: [ansible-project] Re: error using "become"?

2019-09-18 Thread Matt Martz
What is the version of sudo installed on `appsrv98`? I have a feeling that `appsrv98` is a really old machine, maybe running EL5 or something like that. In which case, even if you can get past the sudo issue, you'll run into python version issues as well. On Wed, Sep 18, 2019 at 9:52 AM Mike

[ansible-project] Re: error using "become"?

2019-09-18 Thread Mike Eggleston
Removed Ansible 2.8.5 and installed Ansible 2.8.5. Same error. More simple playbook. Changed "become: yes" to "become:true". Same error: --- - hosts: appsrv98 tasks: - name: test (1/2) command: uptime - name: test (2/2) command: uptime become: true On Wednesday,

[ansible-project] Re: Ansible Contributor Summit 7 (Part of AnsibleFest 2019 Atlanta)

2019-09-18 Thread John Barker
Seth, Yes, though it could be fairly technical in places. If you are attending AnsibleFest check out the "Ansible Community, making your mark" session on Tuesday, or if you aren't attending in person https://www.ansible.com/resources/webinars-training/how-to-make-ansible-community-contributions

[ansible-project] error using "become"?

2019-09-18 Thread Mike Eggleston
GNU/Linux: CentOS Linux release 7.6.1810 (Core) Playbook: --- - hosts: all gather_facts: no vars: md5script: /pawn/bin/md5verify.sh tasks: - name: test (1/3) command: uptime - name: test (2/3) command: uptime become: yes - name: test (2/3) command:

[ansible-project] Re: How can I run the commnads in Linux vm after creation with vmware_guest

2019-09-18 Thread Aravind Balaji
Hi phani akkina, With the help of vmware_vm_shell module( https://docs.ansible.com/ansible/latest/modules/vmware_vm_shell_module.html) you can execute command inside linux vm. *Thanks & Regards*, Aravind Balaji S -- You received this message because you are subscribed to the Google Groups

[ansible-project] How can I run the commnads in Linux vm after creation with vmware_guest

2019-09-18 Thread phani akkina
Hi All, I am deploying vms using *vmware_guest* module in vcenter. I need to run some commands after the creation of the vms either Windows or Linux. I am able run the commands in Windows with runonce. Now I blocked to know how to run the commands in Linux after creation. Can anyone guide me

Re: [ansible-project] ansible 2.8.4 throwing errors on all playbooks

2019-09-18 Thread Andrew Meyer
Sorry I recently updated to CentOS 7.7.1909. I have installed ansible through yum. This is in a home lab and I tried to do a yum history undo ## and it failed broken dependencies. On Wednesday, September 18, 2019 at 2:23:16 AM UTC-5, Vladimir Botka wrote: > > On Tue, 17 Sep 2019 19:06:36

[ansible-project] aws_ec2 inventory plugins: Creating host variables based on AWS tags

2019-09-18 Thread Gert van den Berg
Is there a way to create host variables based on the tags on an instance? (without manually listing each variable and tag under the compose section) The idea is bascially to allow the equivalent of the INI-style inventory file using tags from AWS. (With the relevant variables using a prefix to

[ansible-project] Re: How to use keyed_groups in constructed EC2 inventory with a single tag?

2019-09-18 Thread Gert van den Berg
On Tuesday, June 5, 2018 at 11:55:04 PM UTC+2, WhileLoop wrote: > > Currently inventory.aws_ec2.yaml looks like this: > > > plugin: aws_ec2 > regions: > - us-west-2 > keyed_groups: > - prefix: tag > key: tags > > > This creates one group for every tag combination. How can make it look at

[ansible-project] Re: Can inventory plugin "constructed" create a groups based on ansible_facts

2019-09-18 Thread Gert van den Berg
My guess here is that the inventory gets generated before the setup module runs, which means that the inventory plugin can't be used for that. You should be able to get the desired effect using https://docs.ansible.com/ansible/latest/modules/group_by_module.html - group_by: key: distro_{{

Re: [ansible-project] ansible 2.8.4 throwing errors on all playbooks

2019-09-18 Thread Vladimir Botka
On Tue, 17 Sep 2019 19:06:36 -0700 (PDT) Andrew Meyer wrote: > I just updated CentOS 7 to the latest and now am getting this any playbook > I try to run. > > [andrew@automation01 installer]$ ansible-playbook -i inventory install.yml - > vv > Traceback (most recent call last): > File

Re: [ansible-project] ansible 2.8.4 throwing errors on all playbooks

2019-09-18 Thread Dick Visser
That’s not a lot of information you’re giving. How was ansible installed? What in centos7 exactly did you update to the ‘latest’? What versions mean latest? And what were they before that? Dick On Wed, 18 Sep 2019 at 04:06, Andrew Meyer wrote: > I just updated CentOS 7 to the latest and now

[ansible-project] Re: Issue in download file from FTP

2019-09-18 Thread Naeem Khan
Hi Shivharsh, I tested the YAML syntax online it is showing correct.Kindly suggest the way to correct it here is YAML --- # tasks file for ac.install - name: make a new directory for downloading the installer shell: mkdir -p /installer/NAM #shell: cd /installer/NAM #register:

[ansible-project] Unable to download from FTP using Ansible

2019-09-18 Thread Naeem Khan
Hi Everyone, I am unable to download the file from FTP server, please suggest how can i download file from FTP. My YAML script is as follows. *YAML:-* --- # tasks file for ac.install - name: make a new directory for downloading the installer shell: mkdir -p /installer/NAM #shell: cd