Re: [ansible-project] Install Packages after VM is created in VSphere

2022-07-12 Thread harshc...@gmail.com
Hello Daeme, Thats just great and what i needed. Just a small doubt, what if its a single click deployment process and i want everything to be done without manual intervention. Like create VM, Do patching and the install softwares. But here you told *"Then we add that machine to the inventory"

Re: [ansible-project] Install Packages after VM is created in VSphere

2022-07-12 Thread harshc...@gmail.com
Hello Abhijeet, Thanks for the reply, will try that. Thanks again On Monday, July 11, 2022 at 2:05:56 PM UTC+5:30 abhijeet@gmail.com wrote: > Hi Harsha, > I have used an input yaml file to give all the required variable values > for the role to work. > used this module community.vmware.v

Re: [ansible-project] Passing a variable that is a list to a parameter that expects a list

2022-07-12 Thread Mike Eggleston
The balrog key could interfere with the Gandalf key. :) Mike > On Jul 12, 2022, at 15:54, Ben Coleman wrote: > > In a variables file, I have a series of ssh keys assigned to variables: > > samwise_key: 'ssh-rsa. > legolas_key: 'ssh-rsa > gandalf_key: 'ssh-rsa. > > I then have var

[ansible-project] Passing a variable that is a list to a parameter that expects a list

2022-07-12 Thread Ben Coleman
In a variables file, I have a series of ssh keys assigned to variables: samwise_key: 'ssh-rsa. legolas_key: 'ssh-rsa gandalf_key: 'ssh-rsa. I then have variable defined to be a list of said keys: ssh_keys: - "{{ samwise_key }}" - "{{ legolas_key }}" - "{{ gandalf_key }}" The

Re: [ansible-project] Install Packages after VM is created in VSphere

2022-07-12 Thread daeme...@gmail.com
What I do is we create the vm. I use there a custom role for. Then we add that machine to the inventory. This action in in memory in a prestage group. The prestage group in the inventory has the credential and info to connect. And then we connect to that machine in the same playbook. For a exampl

Re: [ansible-project] Need when condition / solution if possible for running task on a specific host

2022-07-12 Thread Dick Visser
On Tue, 12 Jul 2022 at 08:54, Mohtashim S wrote: > The output is for logging and auditing purposes only. > > The apps may be run by other teams on their intended hosts as mentioned in > the inventory file or on other hosts where they should not be running. > This confirms my suspicion that this

[ansible-project] Ansible 6.1.0 has been released!

2022-07-12 Thread Ompragash Viswanathan
Hi all, We're happy to announce that the Ansible 6.1.0 package has been released ! Ansible 6.1.0 will include ansible-core 2.13.1 as well as a curated set of Ansible collections to provide a vast number of modules and plugins. This is a major version update from Ansible 5.x which included ansi

[ansible-project] Change order of GTM wide ip pools

2022-07-12 Thread Sharon Day
I'm trying to change the order of the two pools assigned to my F5 GTM wide IP. I have a playbook and with this playbook I'm able to change the load balance method but when I change the order for the pools nothing happens. I don't get an error it just doesn't change anything. Has anyone else h

Re: [ansible-project] Create a list from a dictionary cycle

2022-07-12 Thread Softmax23
thx for looking, but the error come from the task débug: tasks: - debug: var: arr not tarr . On Tuesday, July 12, 2022 at 3:30:16 PM UTC+2 jruar...@gmail.com wrote: > I think there's an typo here. There's an extra 't' in list_of_servers: "{{ > tarr|flatten }}" should be > list_of

Re: [ansible-project] Create a list from a dictionary cycle

2022-07-12 Thread Jorge Rúa
I think there's an typo here. There's an extra 't' in list_of_servers: "{{ tarr|flatten }}" should be list_of_servers: "{{ arr|flatten }}" On Tue, Jul 12, 2022, 14:24 Softmax23 wrote: > When i do > arr: "{{ servers|dict2items| > groupby('value')| >

Re: [ansible-project] Create a list from a dictionary cycle

2022-07-12 Thread Softmax23
When i do arr: "{{ servers|dict2items| groupby('value')| map(attribute=1)| map('map', attribute='key')| list }}" list_of_servers: "{{ tarr|flatten }}" tasks: - debug: var: arr the re

Re: [ansible-project] Create a list from a dictionary cycle

2022-07-12 Thread Softmax23
it s not working for me : fatal: [localhost]: FAILED! => {"msg": "Invalid data passed to 'loop', it requires a list, got this instead: , , ]. Hint: If you passed a list/dict of just one element, try adding wantlist=True to your lookup invocation or use q/query instead of lookup."} a co worke

Re: [ansible-project] Create a list from a dictionary cycle

2022-07-12 Thread Softmax23
so i do a past of the play, and it failed ... ansible version 2.9 . I dont know which kind of information you need to try to help me. ( i am not strong in ansible , it s not my work ... i try to find a quickwin to solve an issue. but playbook in my company are not simple to rework .. too m

Re: [ansible-project] Create a list from a dictionary cycle

2022-07-12 Thread Softmax23
so i do a past of the play, and it failed ... ansible version 2.9 . I dont know which kind of information you need to try to help me. ( i am not strong in ansible , it s not my work ... i try to find a quickwin to solve an issue. but playbook in my company are not simple to rework .. too m

Re: [ansible-project] Create a list from a dictionary cycle

2022-07-12 Thread Softmax23
so i do a past of the play, and it failed ... ansible version 2.9 . I dont know which kind of information you need to try to help me. ( i am not strong in ansible , it s not my work ... i try to find a quickwin to solve an issue. but playbook in my company are not simple to rework .. too mu

Re: [ansible-project] Create a list from a dictionary cycle

2022-07-12 Thread Vladimir Botka
On Tue, 12 Jul 2022 02:18:57 -0700 (PDT) Softmax23 wrote: For example, the playbook below shell> cat pb.yml - hosts: localhost vars: servers: srv01: a srv02: a srv03: a srv04: b srv05: b srv06: b srv07: c srv08: c srv09: c arr: "{{

Re: [ansible-project] Launch task with date in var

2022-07-12 Thread Vladimir Botka
On Tue, 12 Jul 2022 11:29:09 +0200 Vladimir Botka wrote: > - debug: > msg: "Launch task for user {{ item.user }} end date." > loop: "{{ users.list }}" > when: item.end == today > - debug: > msg: "Launch task for user {{ item.user }} start date." > loop: "

[ansible-project] Re: Howto to deploy kerberos (krb5.conf) info during awx operator install?

2022-07-12 Thread 'Sebastian Jaekel' via Ansible Project
Hi, Even if you get it working, this will not help. The configuration from the containers is not related to the pod(s) launched when running a playbook. You need to modify the default container group or create a new one. For example, goto "Administration" -> "Instance Groups" and edit the "defa

Re: [ansible-project] Launch task with date in var

2022-07-12 Thread Vladimir Botka
On Tue, 12 Jul 2022 00:09:15 -0700 (PDT) Gabz Modz wrote: > In this CSV, I have a start date and an end date of an employee. > I would like to know if it is possible to process the start date > and end date variable in order to launch a task at that moment? For example, given the file shell> ca

[ansible-project] Create a list from a dictionary cycle

2022-07-12 Thread Softmax23
Hi I would like to create a list with this dict { "v3bf33-srv01": "eu-west0-a", "v3bf33-srv02": "eu-west0-a", "v3bf33-srv03": "eu-west0-a", "v3bf33-srv04": "eu-west0-b", "v3bf33-srv05": "eu-west0-b", "v3bf33-srv06": "eu-west0-b", "v3bf33-srv07": "eu-west0-c", "v3bf33-srv08": "eu-west0-c"

[ansible-project] Create a list from a dictionary cycle

2022-07-12 Thread Fouache Maxime
Hi I would like to create a list with this dict { "v3bf33-srv01": "eu-west0-a", "v3bf33-srv02": "eu-west0-a", "v3bf33-srv03": "eu-west0-a", "v3bf33-srv04": "eu-west0-b", "v3bf33-srv05": "eu-west0-b", "v3bf33-srv06": "eu-west0-b", "v3bf33-srv07": "eu-west0-c", "v3bf33-srv08": "eu-west0-c", "v

[ansible-project] Launch task with date in var

2022-07-12 Thread Gabz Modz
Hello, My playbook allows to create/disable users in the Active Directory, In my playbook, I'm going to look for my role which will allow me to generate my variables according to a CSV. In this CSV, I have a start date and an end date of an employee. I would like to know if it is possible to pr