[ansible-project] ansible read_csv help

2020-07-16 Thread stack flow
Hello, below is my csv and yml file: CVS: tenant,tenant_description tn01,tn01 tn02,tn02 tn03,tn03 YML: --- # Tenants in ACI - name: Create AEPs hosts: apic1 connection: local gather_facts: no tasks: - name: Include Variables read_csv: path: tenants.csv register: tenants - debug: msg: 'tenant

[ansible-project] Would like to update root passwords using user module, but have a different passwords for each VM and read those from a csv file

2020-07-16 Thread Tibor I
Hi Ansible gurus, I have a csv file with a list of hostnames and passwords eg: host1,password1 host2,password2 I can successfully read from that file using the read_csv module. Now I'd like to use the "user" module to update the root password on each host defined in the CSV file. So I've

[ansible-project] acme_certificate account_key* support for sectigo CA

2020-07-16 Thread Victor Olivo
Hello, sectigo is my SSL provider and they support the ACME protocol and I'd like to leverage the acme_certificate module; however, Sectigo seems to use and HMAC key for authentication rather than RSA keys. is it possible to use an HMAC key with the set of acme_* modules for CAs such as

Re: [ansible-project] Working around lookup plugin limitation with environment variables

2020-07-16 Thread Nico H
Hey, have you ever find a solution here ? I face the same problem trying to pass my sts credentials in environment for a role, like this : pre_tasks : - name: Assume role sts_assume_role: role_arn: "arn:aws:iam:::role/myrole" role_session_name: "mysession"

Re: [ansible-project] Need a way to append to a line in a file using items

2020-07-16 Thread Dick Visser
Hi Just appending would result in those groups being appended over and over again if you ran it multiple times. A more idempotent approach is to first fetch the existing list of groups, and append the extra ones to that. This can be run several times. Here is an example using lineinfile: vars:

[ansible-project] Setting cloudformation time output as fact

2020-07-16 Thread takshika jambhule
I'm trying to set up Cloudformation time as fact as below - name: Set Cloud Formation launch time as fact set_fact: elasped_time: "{{ (ansible_date_time.iso8601[:19] | to_datetime(date_fmt) - ansible_facts['cloudformation'][stack_name]['stack_description']['creation_time'][:19] |

[ansible-project] Need a way to append to a line in a file using items

2020-07-16 Thread Michael Starling
Given a line in a file like this simple_allow_groups = access1,access2,access3 I want to be able to use a list of variables and append to that line. simple_allow_groups = access1,access2,access3,access4,access5,access6 I have tried the following code with lineinfile and replace --- - hosts:

Re: [ansible-project] Re: remove mysql

2020-07-16 Thread Dan Linder
The actions that those two tasks perform look to be the same, but you should update the "name:" field to better reflect that the job is removing/un-installing those packages. On Thursday, July 16, 2020 at 8:58:44 AM UTC-5 tdub...@gmail.com wrote: > control server is ubuntu 19.10 > client is

Re: [ansible-project] Re: remove mysql

2020-07-16 Thread Tony Wong
control server is ubuntu 19.10 client is 20.04 ok working now are these 2 pb doing same thing? --- - hosts: all become: true vars_files: - vars/default.yml tasks: - name: Install prerequisites apt: name: - apache2 - mysql-server -

Re: [ansible-project] Windows update by ansible

2020-07-16 Thread 'Leandro Scardua' via Ansible Project
Hi There, You`re using the wrong module here. ansible test_servers -i inventory.ini -m ping The correct module : win_ping https://docs.ansible.com/ansible/latest/modules/win_ping_module.html On Thu, Jul 16, 2020 at 3:16 AM hit d3 wrote: > Hello > > I have one of goals to solve a problem by

Re: [ansible-project] Save output to text file

2020-07-16 Thread Stefan Hornburg (Racke)
On 7/15/20 10:36 PM, Tcpip wrote: > Hello , > > I tried with this configuration  > > - name: SAVE OUTPUT TO FILE >       copy: >         content: "{{ enviro.results[0].stdout }}" >         dest: "/root/playbooks/results/{{ inventory_hostname }}-space.txt" >       tags: save > > But still having

[ansible-project] Windows update by ansible

2020-07-16 Thread hit d3
Hello I have one of goals to solve a problem by ansible. My organization have thousands of WIN10 PCs. However, we have NOT updated WIN10 PCs to recent update. We are asking people to do updating. However, we have already known that there are a lot of machines which have not been updated by