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"* is that 
step manual ? If yes how to make it automated.

Thanks a lot,

*Regards*
*Harsh Chawda*

On Tuesday, July 12, 2022 at 11:49:29 PM UTC+5:30 daeme...@gmail.com wrote:

> 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 example see: create vm 
> 
>
>
> Op maandag 11 juli 2022 om 10:35:56 UTC+2 schreef abhijeet@gmail.com:
>
>> 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.vmware_vm_shell: extensively to avoid 
>> opening fw ports.
>> As I am not connecting the VM over nw i dont need to add it in the 
>> inventory.
>> All required installers are part of the Template but even if they are not 
>> you can use this module  community.vmware.vsphere_copy to copy files 
>> without nw.
>>
>> I am doing this in vCenter so that was the difference against your use 
>> case for Azure.
>>
>> On Mon, 11 Jul 2022 at 06:01, harshc...@gmail.com  
>> wrote:
>>
>>> Hello Abhijeet,
>>>
>>> Thanks a lot for your information. Is there any way i can have a look on 
>>> the roles you built or how you did it? It will be really helpful.
>>> As i am clueless on how to achieve this. I am okay till VM creation, but 
>>> how to connect to the VM on the next task and do activities i am bit 
>>> confused on that.
>>>
>>> Thanks,
>>>
>>> Regards
>>> Harsh
>>>
>>> On Sunday, July 10, 2022 at 7:09:28 PM UTC+5:30 abhijeet@gmail.com 
>>> wrote:
>>>
 Hi Harsh,

 I just finished something like this.
 a Role with multiple tasks to install more  6 agents, make registry 
 changes, add HDDs and format them, add more than one NIC and assign 
 correct 
 IP and a lot more..

 I have another role to Patch the Template working on scheduling that 
 Role/Playbook.

 Warm Regards,
 Abhi

 On Fri, 8 Jul 2022 at 13:31, harshc...@gmail.com  
 wrote:

>
> Hello All,
>
> I am Creating VM in vCenter using *community.vmware.vmware_guest, *after 
> the VM is Created I have certain prerequisites to be fulfilled:
>
>- Do Patching
>- Do some package installation.
>- And some more
>
> How to accomplish this. I am able to create the VM then in the next 
> task how to connect to VM and perform the above mentioned tasks.
>
> Just In case in Terraform there is remote-exec and local-exec modules, 
> after creation of VM in azure i can directly connect to VM using these 
> and 
> do whatever i need.
>
> Can someone please provide the roadmap.
>
> Thanks in advance,
>
> *Regards*
> *Harsh*
>
> -- 
> 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-proje...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/ansible-project/72e29365-729e-4472-9f79-5a798ada0837n%40googlegroups.com
>  
> 
> .
>
 -- 
>>> 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-proje...@googlegroups.com.
>>>
>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/ansible-project/0ec3b687-98cd-4c56-8c00-faa8e6ee4284n%40googlegroups.com
>>>  
>>> 
>>> .
>>>
>>

-- 
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 the web visit 
https://groups.google.com/d/msgid/ansible-project/0838075d-7dcd-4261-9892-d003c45d138cn%40googlegroups.com.


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.vmware_vm_shell: extensively to avoid 
> opening fw ports.
> As I am not connecting the VM over nw i dont need to add it in the 
> inventory.
> All required installers are part of the Template but even if they are not 
> you can use this module  community.vmware.vsphere_copy to copy files 
> without nw.
>
> I am doing this in vCenter so that was the difference against your use 
> case for Azure.
>
> On Mon, 11 Jul 2022 at 06:01, harshc...@gmail.com  
> wrote:
>
>> Hello Abhijeet,
>>
>> Thanks a lot for your information. Is there any way i can have a look on 
>> the roles you built or how you did it? It will be really helpful.
>> As i am clueless on how to achieve this. I am okay till VM creation, but 
>> how to connect to the VM on the next task and do activities i am bit 
>> confused on that.
>>
>> Thanks,
>>
>> Regards
>> Harsh
>>
>> On Sunday, July 10, 2022 at 7:09:28 PM UTC+5:30 abhijeet@gmail.com 
>> wrote:
>>
>>> Hi Harsh,
>>>
>>> I just finished something like this.
>>> a Role with multiple tasks to install more  6 agents, make registry 
>>> changes, add HDDs and format them, add more than one NIC and assign correct 
>>> IP and a lot more..
>>>
>>> I have another role to Patch the Template working on scheduling that 
>>> Role/Playbook.
>>>
>>> Warm Regards,
>>> Abhi
>>>
>>> On Fri, 8 Jul 2022 at 13:31, harshc...@gmail.com  
>>> wrote:
>>>

 Hello All,

 I am Creating VM in vCenter using *community.vmware.vmware_guest, *after 
 the VM is Created I have certain prerequisites to be fulfilled:

- Do Patching
- Do some package installation.
- And some more

 How to accomplish this. I am able to create the VM then in the next 
 task how to connect to VM and perform the above mentioned tasks.

 Just In case in Terraform there is remote-exec and local-exec modules, 
 after creation of VM in azure i can directly connect to VM using these and 
 do whatever i need.

 Can someone please provide the roadmap.

 Thanks in advance,

 *Regards*
 *Harsh*

 -- 
 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-proje...@googlegroups.com.
 To view this discussion on the web visit 
 https://groups.google.com/d/msgid/ansible-project/72e29365-729e-4472-9f79-5a798ada0837n%40googlegroups.com
  
 
 .

>>> -- 
>> 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-proje...@googlegroups.com.
>>
> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/ansible-project/0ec3b687-98cd-4c56-8c00-faa8e6ee4284n%40googlegroups.com
>>  
>> 
>> .
>>
>

-- 
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 the web visit 
https://groups.google.com/d/msgid/ansible-project/0bf59356-efef-4027-b0f0-b65bebbd1a43n%40googlegroups.com.


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 variable defined to be a list of said keys:
> 
> ssh_keys:
>  - "{{ samwise_key }}"
>  - "{{ legolas_key }}"
>  - "{{ gandalf_key }}"
> 
> The idea is to be able to set up such keys (which are used in multiple places 
> in my Ansible scripts) in one place, instead of having to put them in each 
> place they're used.
> 
> One of the places I need to use them is when creating a new linode.  The 
> linode_v4 module has a parameter authorized_keys, which expects a list.
> 
> I've got this set up as:
> 
> - name: Create a new linode
>  linode_v4:
>label: "{{ label }}.domainname.com
>type: g6-nanode-1
>region: us-southeast
>image: linode/ubuntu20.04
>root_pass: "yeah, like I'm going to include that in here"
>authorized_keys: "{{ ssh_keys }}"
>state: present
>  register: my_linode
> 
> 
> I believe this has worked in the past, but currently (under ansible 2.12.3), 
> when I run this, I'm getting:
> 
> fatal: [localhost]: FAILED! => {"changed": false, "msg": "Unable to query the 
> Linode API.  Saw: authorized_keys must be either paths to the key files or a 
> list of raw public key of one of these types: ('ssh-dss', 'ssh-rsa', 
> 'ecdsa-sha2-nistp', 'ssh-ed25519')"}
> 
> If I copy the keys to an explicit list under authorized keys, like so:
> 
>authorized_keys:
>  - 'ssh-rsa..
>  - 'ssh-rsa..
>  - 'ssh-rsa..
> 
> it works, which seems to eliminate the possibility that I'm using a key type 
> that's not recognized (my actual list has more than ssh-rsa keys).
> 
> Which leaves me wondering: how do I pass this ssh_keys variable to the 
> authorized_keys parameter correctly?
> 
> Ben
> -- 
> Ben Coleman olo...@benshome.net | For the wise man, doing right trumps
> http://oloryn.benshome.net/ | looking right.  For the fool, looking
> Amateur Radio NJ8J  | right trumps doing right.
> 
> -- 
> 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 the web visit 
> https://groups.google.com/d/msgid/ansible-project/8e9e9524-33ba-3bcb-0d19-9ee9236bc675%40benshome.net.

-- 
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 the web visit 
https://groups.google.com/d/msgid/ansible-project/B7F63942-160C-4903-9450-19D6F0C6E184%40gmail.com.


OpenPGP_signature
Description: Binary data


[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 idea is to be able to set up such keys (which are used in multiple 
places in my Ansible scripts) in one place, instead of having to put 
them in each place they're used.


One of the places I need to use them is when creating a new linode.  The 
linode_v4 module has a parameter authorized_keys, which expects a list.


I've got this set up as:

- name: Create a new linode
  linode_v4:
label: "{{ label }}.domainname.com
type: g6-nanode-1
region: us-southeast
image: linode/ubuntu20.04
root_pass: "yeah, like I'm going to include that in here"
authorized_keys: "{{ ssh_keys }}"
state: present
  register: my_linode


I believe this has worked in the past, but currently (under ansible 
2.12.3), when I run this, I'm getting:


fatal: [localhost]: FAILED! => {"changed": false, "msg": "Unable to 
query the Linode API.  Saw: authorized_keys must be either paths to the 
key files or a list of raw public key of one of these types: ('ssh-dss', 
'ssh-rsa', 'ecdsa-sha2-nistp', 'ssh-ed25519')"}


If I copy the keys to an explicit list under authorized keys, like so:

authorized_keys:
  - 'ssh-rsa..
  - 'ssh-rsa..
  - 'ssh-rsa..

it works, which seems to eliminate the possibility that I'm using a key 
type that's not recognized (my actual list has more than ssh-rsa keys).


Which leaves me wondering: how do I pass this ssh_keys variable to the 
authorized_keys parameter correctly?


Ben
--
Ben Coleman olo...@benshome.net | For the wise man, doing right trumps
http://oloryn.benshome.net/ | looking right.  For the fool, looking
Amateur Radio NJ8J  | right trumps doing right.

--
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 the web visit 
https://groups.google.com/d/msgid/ansible-project/8e9e9524-33ba-3bcb-0d19-9ee9236bc675%40benshome.net.


OpenPGP_signature
Description: OpenPGP digital signature


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 example see: create vm 



Op maandag 11 juli 2022 om 10:35:56 UTC+2 schreef abhijeet@gmail.com:

> 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.vmware_vm_shell: extensively to avoid 
> opening fw ports.
> As I am not connecting the VM over nw i dont need to add it in the 
> inventory.
> All required installers are part of the Template but even if they are not 
> you can use this module  community.vmware.vsphere_copy to copy files 
> without nw.
>
> I am doing this in vCenter so that was the difference against your use 
> case for Azure.
>
> On Mon, 11 Jul 2022 at 06:01, harshc...@gmail.com  
> wrote:
>
>> Hello Abhijeet,
>>
>> Thanks a lot for your information. Is there any way i can have a look on 
>> the roles you built or how you did it? It will be really helpful.
>> As i am clueless on how to achieve this. I am okay till VM creation, but 
>> how to connect to the VM on the next task and do activities i am bit 
>> confused on that.
>>
>> Thanks,
>>
>> Regards
>> Harsh
>>
>> On Sunday, July 10, 2022 at 7:09:28 PM UTC+5:30 abhijeet@gmail.com 
>> wrote:
>>
>>> Hi Harsh,
>>>
>>> I just finished something like this.
>>> a Role with multiple tasks to install more  6 agents, make registry 
>>> changes, add HDDs and format them, add more than one NIC and assign correct 
>>> IP and a lot more..
>>>
>>> I have another role to Patch the Template working on scheduling that 
>>> Role/Playbook.
>>>
>>> Warm Regards,
>>> Abhi
>>>
>>> On Fri, 8 Jul 2022 at 13:31, harshc...@gmail.com  
>>> wrote:
>>>

 Hello All,

 I am Creating VM in vCenter using *community.vmware.vmware_guest, *after 
 the VM is Created I have certain prerequisites to be fulfilled:

- Do Patching
- Do some package installation.
- And some more

 How to accomplish this. I am able to create the VM then in the next 
 task how to connect to VM and perform the above mentioned tasks.

 Just In case in Terraform there is remote-exec and local-exec modules, 
 after creation of VM in azure i can directly connect to VM using these and 
 do whatever i need.

 Can someone please provide the roadmap.

 Thanks in advance,

 *Regards*
 *Harsh*

 -- 
 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-proje...@googlegroups.com.
 To view this discussion on the web visit 
 https://groups.google.com/d/msgid/ansible-project/72e29365-729e-4472-9f79-5a798ada0837n%40googlegroups.com
  
 
 .

>>> -- 
>> 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-proje...@googlegroups.com.
>>
> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/ansible-project/0ec3b687-98cd-4c56-8c00-faa8e6ee4284n%40googlegroups.com
>>  
>> 
>> .
>>
>

-- 
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 the web visit 
https://groups.google.com/d/msgid/ansible-project/a0182ba3-e635-47f0-b0d6-a460beb7b1f3n%40googlegroups.com.


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 isn't a technical problem but rather
an organisational one.
Since I don't believe in fixing organisational problems with technological
measures, I won't be able to help you with that.
Somebody else might, though.

>
> The dumps would help identify where the app was actually running at the
> time of play and then the play may choose to start / stop the app at the
> intended host.
>
> This is a real-world problem and any solution would be appretiated.
>
> On Tuesday, July 12, 2022 at 9:34:49 AM UTC+5:30 dnmv...@gmail.com wrote:
>
>> Suppose your playbook does what you (think) you want. Then what do you
>> intend to do with this output?
>> What if some apps are running on hosts they're not intended to run on? Do
>> you take some corrective measures? Or reinstall the host?
>> And why is it possible at all that apps appear on random inventory hosts?
>>
>> Rather than using ansible as a glorified shell wrapper to report proces
>> status, I would use it to set up the infra so that only the right apps run
>> on the right hosts.
>>
>>
>> On Tue, 12 Jul 2022 at 00:16, Mohtashim S  wrote:
>>
>>> I have 3 applications hosted on three separate hosts and mentioned in
>>> the hosts file like below:
>>>
>>> cat my.hosts
>>>
>>> [app1_webapp]
>>> host3.mybank.com
>>>
>>> [app2_webapp]
>>> host5.mybank.com
>>>
>>> [app3_webapp]
>>> host8.mybank.com
>>> My requirement is to run two types of raw module commands.
>>>
>>> The first raw task which should run on all three hosts for all three
>>> applications i.e uptime
>>>
>>> The second raw task is ps command that should run only on the respective
>>> host i.e ps -ef | grep app1 should only run on host3.mybank.com
>>>
>>> Below is how I call my main.yml
>>>
>>> ansible-playbook -i my.hosts main.yml -e appname=app1,app2,app3
>>>
>>> cat main.yml
>>>
>>> - hosts: "{{ product(appname.split(',')) |
>>> product(['webapp'])|map('flatten')|map('join', '_') }}"
>>>
>>>   user: user1
>>>   gather_facts: no
>>>
>>>   tasks:
>>>
>>>- name: Check Running Process
>>>  raw: "ps -ef | grep {{ item }}"
>>>  register: psout
>>>  with_items: "{{ appname.split(',') }}"
>>>
>>>- name: DUMP Running Process
>>>  debug:
>>>msg: "{{ psout.stdout }}"
>>>
>>> The above raw fails as it tried ps for each app on each hosts which is
>>> what I wish to skip (correct).
>>>
>>> How do I put a when condition so that the ps command for the respective
>>> app should run on the respective host only and not on all three hosts?
>>>
>>> Summary: my problem is regarding standard practice in infrastructure
>>> management. Each app runs on its own host as specified in the my.hosts
>>> file. I wish to find if the app process ps -ef | grep  is running
>>> on its own host(desired) and not on all inventory-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-proje...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/ansible-project/ef324a05-5da8-41e2-b214-611dfdc9afcbn%40googlegroups.com
>>> 
>>> .
>>>
>> --
>> Sent from Gmail Mobile
>>
> --
> 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 the web visit
> https://groups.google.com/d/msgid/ansible-project/c9b56ba9-b861-41f0-82ef-5fd4e333eb2en%40googlegroups.com
> 
> .
>
-- 
Sent from Gmail Mobile

-- 
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 the web visit 
https://groups.google.com/d/msgid/ansible-project/CAF8BbLYuZ1H3to1fu10m59-vyMzDrOKAgmf3jBd%3Db1rvzLQ8Pg%40mail.gmail.com.


[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

ansible-core 2.12 and there may be backwards incompatibilities in the

core playbook language.

How to get it

-

This pre-release is available on PyPI and can be installed with pip:

```

$ pip install ansible==6.1.0 --user

```

The sources for this release can be found here:

Release tarball:

https://pypi.python.org/packages/source/a/ansible/ansible-6.1.0.tar.gz

SHA256: 91e4b23945f190aaa123c6ba4f8accb8e7f8905991bd3bb19b89afbdca456822

Wheel package:
https://files.pythonhosted.org/packages/py3/a/ansible/ansible-6.1.0-py3-none-any.whl


SHA256: 52c89558d4ab8238828f1b98f653b148738065895cefbef9c174beb663bea3a0

What's new in Ansible 6

---

* New command-line utility “ansible-community” is added in Ansible 6 to
check the installed version of Ansible Community package.

```

$ ansible-community --version

Ansible community version 6.1.0

```

* Python wheels are now available for both Ansible 6 and ansible-core

2.13.x, resulting in significantly improved installation performance.

* In addition, Ansible 6 will no longer install some unnecessary files

from the included Ansible collections such as tests or hidden files &

directories in order to further improve installation performance and

reduce the size on disk. These files are still available in the source

tarball if necessary.

* The changelog for ansible-core 2.13 installed by this release of

ansible is available here:

https://github.com/ansible/ansible/blob/stable-2.13/changelogs/CHANGELOG-v2.13.rst

* Collections which have opted into being a part of the Ansible-6

unified changelog will have an entry on this page:

https://github.com/ansible-community/ansible-build-data/blob/main/6/CHANGELOG-v6.rst

* For collections which have not opted into the unified changelog, you

may find more information on https://galaxy.ansible.com or their

source repository.

For example, the community.crypto collection would be found at

https://galaxy.ansible.com/community/crypto and you can find a link to

the source repository under the "Repo" button at the top right.

What's the schedule for new Ansible releases after 6.1.0 ?

-

* Maintenance releases of Ansible 6.x will occur approximately every

three weeks (Ansible 6.1.0, Ansible 6.2.0, etc) until the release of

Ansible 7.0.0. They will contain bugfixes and new features but no

backwards incompatibilities.

* Please note that the release of ansible-core 2.13 coincides with the
end-of-life of ansible 2.9 and ansible-base 2.10:

https://groups.google.com/g/ansible-announce/c/kegIH5_okmg/

Porting Help

-

A unified porting guide for collections which have opted-in is available
here:

https://docs.ansible.com/ansible/devel/porting_guides/porting_guide_6.html

Getting collection updates from Ansible 6 with older releases of
ansible-core

-

Ansible 6 includes ansible-core 2.13.x and users have expressed an interest

in getting collection updates as they ship in the Ansible "batteries

included" package while keeping an older version of ansible-core based

on their needs and requirements.

An ansible-galaxy requirements file based on the collections from

Ansible 6 has been made available for this use case:

https://github.com/ansible-community/ansible-build-data/blob/main/6/galaxy-requirements.yaml

Once the requirements file has been downloaded, the collections can be

installed by running:

"ansible-galaxy collection install -r galaxy-requirements.yaml"

On behalf of the Ansible community, thank you and happy automating!

-- 
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 the web visit 
https://groups.google.com/d/msgid/ansible-project/CAJm9AsQ8kCXzeZq-Gze-Ec-r65ujyY0f-%3DRLHzNYL_qnL5v9-A%40mail.gmail.com.


[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 had 
this experience.

- name: Change pool order
  bigip_gtm_wide_ip:
pool_lb_method: global-availability
name: wide-ip-1
type: a
pools:
  - name: pool-1  -> pool-1 is currently set to order of 0
order: 1
  - name: pool-2
order: 0  -> pool-2 is currently set to order of 1
provider:
server_port: 443
server: "{{ inventory_hostname }}"
validate_certs: no
  delegate_to: localhost

-- 
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 the web visit 
https://groups.google.com/d/msgid/ansible-project/e9d8f815-b0a7-423e-bf04-1c2e6121d9b1n%40googlegroups.com.


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_servers: "{{ arr|flatten }}"
>
> On Tue, Jul 12, 2022, 14:24 Softmax23  wrote:
>
>> 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 result , no data.   
>>
>> TASK [debug] 
>> **
>> ok: [localhost] => {
>> "arr": "[, > object do_map at 0x7f1c51cac9e0>,
>>  ]"
>> }
>>
>>
>>
>> On Tuesday, July 12, 2022 at 11:59:52 AM UTC+2 vbo...@gmail.com wrote:
>>
>>> 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: "{{ servers|dict2items| 
>>> groupby('value')| 
>>> map(attribute=1)| 
>>> map('map', attribute='key')| 
>>> list }}" 
>>> list_of_servers: "{{ tarr|flatten }}" 
>>> tasks: 
>>> - set_fact: 
>>> tarr: "{{ tarr|d(arr.0)|zip(item)|map('flatten') }}" 
>>> loop: "{{ arr[1:] }}" 
>>> - debug: 
>>> var: list_of_servers[:5]|to_yaml 
>>>
>>> 1) Creates the matrix 
>>>
>>> arr: 
>>> - [srv01, srv02, srv03] 
>>> - [srv04, srv05, srv06] 
>>> - [srv07, srv08, srv09] 
>>>
>>> 2) Transpose the matrix 
>>>
>>> tarr: 
>>> - [srv01, srv04, srv07] 
>>> - [srv02, srv05, srv08] 
>>> - [srv03, srv06, srv09] 
>>>
>>> 3) Get the slice 
>>>
>>> list_of_servers[:5]: [srv01, srv04, srv07, srv02, srv05] 
>>>
>>> -- 
>>> Vladimir Botka 
>>>
>> -- 
>> 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-proje...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/ansible-project/a38eebfa-d815-45fb-a2f3-0c57529bac66n%40googlegroups.com
>>  
>> 
>> .
>>
>

-- 
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 the web visit 
https://groups.google.com/d/msgid/ansible-project/3d87b5f2-851e-4cee-9e39-8144f899abb1n%40googlegroups.com.


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')|
>   map(attribute=1)|
>   map('map', attribute='key')|
>   list }}"
>   list_of_servers: "{{ tarr|flatten }}"
>   tasks:
> - debug:
> var: arr
>
> the result , no data.
>
> TASK [debug]
> **
> ok: [localhost] => {
> "arr": "[,  object do_map at 0x7f1c51cac9e0>,
>  ]"
> }
>
>
>
> On Tuesday, July 12, 2022 at 11:59:52 AM UTC+2 vbo...@gmail.com wrote:
>
>> 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: "{{ servers|dict2items|
>> groupby('value')|
>> map(attribute=1)|
>> map('map', attribute='key')|
>> list }}"
>> list_of_servers: "{{ tarr|flatten }}"
>> tasks:
>> - set_fact:
>> tarr: "{{ tarr|d(arr.0)|zip(item)|map('flatten') }}"
>> loop: "{{ arr[1:] }}"
>> - debug:
>> var: list_of_servers[:5]|to_yaml
>>
>> 1) Creates the matrix
>>
>> arr:
>> - [srv01, srv02, srv03]
>> - [srv04, srv05, srv06]
>> - [srv07, srv08, srv09]
>>
>> 2) Transpose the matrix
>>
>> tarr:
>> - [srv01, srv04, srv07]
>> - [srv02, srv05, srv08]
>> - [srv03, srv06, srv09]
>>
>> 3) Get the slice
>>
>> list_of_servers[:5]: [srv01, srv04, srv07, srv02, srv05]
>>
>> --
>> Vladimir Botka
>>
> --
> 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 the web visit
> https://groups.google.com/d/msgid/ansible-project/a38eebfa-d815-45fb-a2f3-0c57529bac66n%40googlegroups.com
> 
> .
>

-- 
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 the web visit 
https://groups.google.com/d/msgid/ansible-project/CAFtje5Mi%2Bob5QL1Hf8jod3ebM5jtNfLnM9q9kwbLRCJRgggRuA%40mail.gmail.com.


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 result , no data.   

TASK [debug] 
**
ok: [localhost] => {
"arr": "[, ,
 ]"
}



On Tuesday, July 12, 2022 at 11:59:52 AM UTC+2 vbo...@gmail.com wrote:

> 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: "{{ servers|dict2items|
> groupby('value')|
> map(attribute=1)|
> map('map', attribute='key')|
> list }}"
> list_of_servers: "{{ tarr|flatten }}"
> tasks:
> - set_fact:
> tarr: "{{ tarr|d(arr.0)|zip(item)|map('flatten') }}"
> loop: "{{ arr[1:] }}"
> - debug:
> var: list_of_servers[:5]|to_yaml
>
> 1) Creates the matrix
>
> arr:
> - [srv01, srv02, srv03]
> - [srv04, srv05, srv06]
> - [srv07, srv08, srv09]
>
> 2) Transpose the matrix
>
> tarr:
> - [srv01, srv04, srv07]
> - [srv02, srv05, srv08]
> - [srv03, srv06, srv09]
>
> 3) Get the slice
>
> list_of_servers[:5]: [srv01, srv04, srv07, srv02, srv05]
>
> -- 
> Vladimir Botka
>

-- 
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 the web visit 
https://groups.google.com/d/msgid/ansible-project/a38eebfa-d815-45fb-a2f3-0c57529bac66n%40googlegroups.com.


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 worker try too .. .same result.   i think i  will go  in BASH... i am 
sure it will work .  ahahah

On Tuesday, July 12, 2022 at 11:59:52 AM UTC+2 vbo...@gmail.com wrote:

> 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: "{{ servers|dict2items|
> groupby('value')|
> map(attribute=1)|
> map('map', attribute='key')|
> list }}"
> list_of_servers: "{{ tarr|flatten }}"
> tasks:
> - set_fact:
> tarr: "{{ tarr|d(arr.0)|zip(item)|map('flatten') }}"
> loop: "{{ arr[1:] }}"
> - debug:
> var: list_of_servers[:5]|to_yaml
>
> 1) Creates the matrix
>
> arr:
> - [srv01, srv02, srv03]
> - [srv04, srv05, srv06]
> - [srv07, srv08, srv09]
>
> 2) Transpose the matrix
>
> tarr:
> - [srv01, srv04, srv07]
> - [srv02, srv05, srv08]
> - [srv03, srv06, srv09]
>
> 3) Get the slice
>
> list_of_servers[:5]: [srv01, srv04, srv07, srv02, srv05]
>
> -- 
> Vladimir Botka
>

-- 
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 the web visit 
https://groups.google.com/d/msgid/ansible-project/893d2802-3073-4068-9dd7-198a40dc6f39n%40googlegroups.com.


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 much " personnal view " in playbooks .. ) 

TASK [set_fact] 
***
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."}

PLAY RECAP 

localhost  : ok=0changed=0unreachable=0failed=1 
   skipped=0rescued=0ignored=0


You  say it s work for you ... i really not good.so .. 


On Tuesday, July 12, 2022 at 11:59:52 AM UTC+2 vbo...@gmail.com wrote:

> 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: "{{ servers|dict2items|
> groupby('value')|
> map(attribute=1)|
> map('map', attribute='key')|
> list }}"
> list_of_servers: "{{ tarr|flatten }}"
> tasks:
> - set_fact:
> tarr: "{{ tarr|d(arr.0)|zip(item)|map('flatten') }}"
> loop: "{{ arr[1:] }}"
> - debug:
> var: list_of_servers[:5]|to_yaml
>
> 1) Creates the matrix
>
> arr:
> - [srv01, srv02, srv03]
> - [srv04, srv05, srv06]
> - [srv07, srv08, srv09]
>
> 2) Transpose the matrix
>
> tarr:
> - [srv01, srv04, srv07]
> - [srv02, srv05, srv08]
> - [srv03, srv06, srv09]
>
> 3) Get the slice
>
> list_of_servers[:5]: [srv01, srv04, srv07, srv02, srv05]
>
> -- 
> Vladimir Botka
>

-- 
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 the web visit 
https://groups.google.com/d/msgid/ansible-project/27910144-a130-4e3c-bfab-afdb9408b1d8n%40googlegroups.com.


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 much " personnal view " in playbooks .. ) 

TASK [set_fact] 
***
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."}

PLAY RECAP 

localhost  : ok=0changed=0unreachable=0failed=1 
   skipped=0rescued=0ignored=0


You  say it s work for you ... i really not good.so .. 


On Tuesday, July 12, 2022 at 11:59:52 AM UTC+2 vbo...@gmail.com wrote:

> 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: "{{ servers|dict2items|
> groupby('value')|
> map(attribute=1)|
> map('map', attribute='key')|
> list }}"
> list_of_servers: "{{ tarr|flatten }}"
> tasks:
> - set_fact:
> tarr: "{{ tarr|d(arr.0)|zip(item)|map('flatten') }}"
> loop: "{{ arr[1:] }}"
> - debug:
> var: list_of_servers[:5]|to_yaml
>
> 1) Creates the matrix
>
> arr:
> - [srv01, srv02, srv03]
> - [srv04, srv05, srv06]
> - [srv07, srv08, srv09]
>
> 2) Transpose the matrix
>
> tarr:
> - [srv01, srv04, srv07]
> - [srv02, srv05, srv08]
> - [srv03, srv06, srv09]
>
> 3) Get the slice
>
> list_of_servers[:5]: [srv01, srv04, srv07, srv02, srv05]
>
> -- 
> Vladimir Botka
>

-- 
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 the web visit 
https://groups.google.com/d/msgid/ansible-project/090ca177-246f-44ef-b1aa-b5006cb1ee06n%40googlegroups.com.


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 much " personnal view " in playbooks .. ) 

TASK [set_fact] 
***
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."}

PLAY RECAP 

localhost  : ok=0changed=0unreachable=0failed=1 
   skipped=0rescued=0ignored=0


You  say it s work for you ... i really not good.so .. 



On Tuesday, July 12, 2022 at 11:59:52 AM UTC+2 vbo...@gmail.com wrote:

> 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: "{{ servers|dict2items|
> groupby('value')|
> map(attribute=1)|
> map('map', attribute='key')|
> list }}"
> list_of_servers: "{{ tarr|flatten }}"
> tasks:
> - set_fact:
> tarr: "{{ tarr|d(arr.0)|zip(item)|map('flatten') }}"
> loop: "{{ arr[1:] }}"
> - debug:
> var: list_of_servers[:5]|to_yaml
>
> 1) Creates the matrix
>
> arr:
> - [srv01, srv02, srv03]
> - [srv04, srv05, srv06]
> - [srv07, srv08, srv09]
>
> 2) Transpose the matrix
>
> tarr:
> - [srv01, srv04, srv07]
> - [srv02, srv05, srv08]
> - [srv03, srv06, srv09]
>
> 3) Get the slice
>
> list_of_servers[:5]: [srv01, srv04, srv07, srv02, srv05]
>
> -- 
> Vladimir Botka
>

-- 
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 the web visit 
https://groups.google.com/d/msgid/ansible-project/543b5bd9-2d49-4ae1-b2a5-cb99270f081an%40googlegroups.com.


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: "{{ servers|dict2items|
 groupby('value')|
 map(attribute=1)|
 map('map', attribute='key')|
 list }}"
list_of_servers: "{{ tarr|flatten }}"
  tasks:
- set_fact:
tarr: "{{ tarr|d(arr.0)|zip(item)|map('flatten') }}"
  loop: "{{ arr[1:] }}"
- debug:
var: list_of_servers[:5]|to_yaml

1) Creates the matrix

  arr:
- [srv01, srv02, srv03]
- [srv04, srv05, srv06]
- [srv07, srv08, srv09]

2) Transpose the matrix

  tarr:
- [srv01, srv04, srv07]
- [srv02, srv05, srv08]
- [srv03, srv06, srv09]

3) Get the slice

  list_of_servers[:5]: [srv01, srv04, srv07, srv02, srv05]

-- 
Vladimir Botka

-- 
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 the web visit 
https://groups.google.com/d/msgid/ansible-project/20220712115932.3ac6a25b%40gmail.com.


pgpOknimSvIKx.pgp
Description: OpenPGP digital signature


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: "{{ users.list }}"
>   when: item.start == today

Instead of the condition, use more efficient *selectattr*. The tasks
below give the same result

- debug:
msg: "Launch task for user {{ item.user }} end date."
  loop: "{{ users.list|selectattr('end', '==', today) }}"
- debug:
msg: "Launch task for user {{ item.user }} start date."
  loop: "{{ users.list|selectattr('start', '==', today) }}"

-- 
Vladimir Botka

-- 
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 the web visit 
https://groups.google.com/d/msgid/ansible-project/20220712113822.2e3d5bd4%40gmail.com.


pgpd3NsZlvW4z.pgp
Description: OpenPGP digital signature


[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 "default" 
group.
Change spec to something like this (maybe you need to change the name of 
the configMap in volumes section):

apiVersion: v1
kind: Pod
metadata:
  namespace: awxop
spec:
  serviceAccountName: default
  automountServiceAccountToken: false
  containers:
- image: 'quay.io/ansible/awx-ee:latest'
  name: worker
  args:
- ansible-runner
- worker
- '--private-data-dir=/runner'
  resources:
requests:
  cpu: 250m
  memory: 100Mi
  volumeMounts:
   - name: krb5-conf
 mountPath: /etc/krb5.conf
 subPath: krb5.conf
  volumes:
- name: krb5-conf
  configMap:
name: awx-demo-extra-config


Regards

Sebastian


urs...@gmail.com schrieb am Dienstag, 14. Juni 2022 um 15:16:25 UTC+2:

> OK, I think I have part of an answer but I am not getting the syntax right 
> for a successful Kubernetes deployment it looks like.
>
> Can somebody look this over and help me out in getting the yaml file 
> syntax right, please? 
>
> ###
> # part 1 my ‘kustomization.yaml' file #
> ###
> ---
> apiVersion: kustomize.config.k8s.io/v1beta1
> kind: Kustomization
> resources:
>   # Find the latest tag here: 
> https://github.com/ansible/awx-operator/releases
>   - github.com/ansible/awx-operator/config/default?ref=0.22.0
>   - awx-myorg_awx.yaml
>
> # Set the image tags to match the git version from above
> images:
>   - name: quay.io/ansible/awx-operator
> newTag: 0.22.0
>
> # Specify a custom namespace in which to install AWX
> namespace: awx
>
> ###
> # part 2 my ‘awx-myorg_awx.yaml’ file  #
> ###
> ---
> kind: ConfigMap
> apiVersion: v1
> metadata:
>   name: awx-myorg
>   namespace: awx
> data:
>   krb5.conf: |-
> # To opt out of the system crypto-policies configuration of krb5, 
> remove the
> # symlink at /etc/krb5.conf.d/crypto-policies which will not be 
> recreated.
> # includedir /etc/krb5.conf.d/
> # my myorg krb5.conf file
> includedir /etc/krb5.conf.d/
>
> [libdefaults]
> default_realm = MYORG.DOM
>
> # The follodomg krb5.conf variables are only for MIT Kerberos.
> kdc_timesync = 1
> ccache_type = 4
> forwardable = true
> proxiable = true
>
> # The follodomg encryption type specification will be used by MIT 
> Kerberos
> # if uncommented.  In general, the defaults in the MIT Kerberos code 
> are
> # correct and overriding these specifications only serves to disable 
> new
> # encryption types as they are added, creating interoperability 
> problems.
> #
> # The only time when you might need to uncomment these lines and change
> # the enctypes is if you have local software that will break on ticket
> # caches containing ticket encryption types it doesn't know about 
> (such as
> # old versions of Sun Java).
>
> #   default_tgs_enctypes = des3-hmac-sha1
> #   default_tkt_enctypes = des3-hmac-sha1
> #   permitted_enctypes = des3-hmac-sha1
>
> # The follodomg libdefaults parameters are only for Heimdal Kerberos.
> fcc-mit-ticketflags = true
>
> [realms]
> MYORG.DOM = {
> kdc = dc1.myorg.dom
> kdc = dc2.myorg.dom
> admin_server = dc1.myorg.dom
> default_domain = MYORG.DOM
> }
> [domain_realm]
> .myorg.dom = MYORG.DOM
>
> ---
> apiVersion: awx.ansible.com/v1beta1
> kind: AWX
> metadata:
>   name: awx-myorg
> spec:
>   service_type: nodeport
>   web_extra_volume_mounts: |
> - name: krb5-conf
>   mountPath: /etc/krb5.conf
>   subPath: krb5.conf
>   task_extra_volume_mounts: |
> - name: krb5-conf
>   mountPath: /etc/krb5.conf
>   subPath: krb5.conf
>   ee_extra_volume_mounts: |
> - name: krb5-conf
>   mountPath: /etc/krb5.conf
>   subPath: krb5.conf
>   extra_volumes: |
> - name: krb5-conf
>   configMap:
> defaultMode: 420
> items:
>   - key: krb5.conf
> path: krb5.conf
> name: awx-myorg
>
>
> kustomize accepts this when I issue a 
> VERSION=0.22.0 kustomize build . | kubectl apply -f -
>
> BUT it never finishes building the containers. Evan after a full hour it 
> is still in building container state.
> Can somebody do the necessary edits to make the above apply and build the 
> awx cluster successfully, please? 
>
> Thanks in advance. 
>
> Urs Rau
>
> On Monday, 13 June 2022 at 12:23:36 UTC+2 Urs Rau wrote:
>
>> I am deploying awx 21.1.0 using the 0.22.0 op

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> cat users.csv
2022-01-01,2023-01-01,admin
2022-01-01,2022-07-12,alice
2022-07-12,2023-01-01,bob

The playbook below

shell> cat pb.yml
- hosts: localhost
  vars:
date_format: "%Y-%m-%d"
today: "{{ date_format|strftime }}"
  tasks:
- community.general.read_csv:
path: "{{ playbook_dir }}/users.csv"
fieldnames: start,end,user
  register: users
- 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: "{{ users.list }}"
  when: item.start == today

gives (abridged)

  msg: Launch task for user alice end date.
  msg: Launch task for user bob start date.

-- 
Vladimir Botka

-- 
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 the web visit 
https://groups.google.com/d/msgid/ansible-project/20220712112909.0f48200d%40gmail.com.


pgppEc7EGKFzP.pgp
Description: OpenPGP digital signature


[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", 
"v3bf33-srv09": "eu-west0-c" } 

if a user ask 5 servers ( in a pipeline), cycle through servers of each 
value:

eu-west0-a,

eu-west0-b,

eu-west0-c,

then again , eu-west0-a, eu-west0-b, eu-west0-c  until reach number of 
server need

The result should be a list containing only the server name.

E.g.:
- v3bf33-srv01 #eu-west0-a 
- v3bf33-srv04 #eu-west0-b 
- v3bf33-srv07 #eu-west0-c 
- v3bf33-srv02 #eu-west0-a -
 v3bf33-srv05 #eu-west0-b 

any help is welcome. ^^

-- 
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 the web visit 
https://groups.google.com/d/msgid/ansible-project/33371bfe-518f-4f11-adce-8712f23e1c2en%40googlegroups.com.


[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", "v3bf33-srv09": "eu-west0-c" } 

if a user ask 5 servers ( in a pipeline), cycle through servers of each 
value:

eu-west0-a,

eu-west0-b,

eu-west0-c,

then again , eu-west0-a, eu-west0-b, eu-west0-c  until reach number of 
server need

The result should be a list containing only the server name.

E.g.:
- v3bf33-srv01 #eu-west0-a - v3bf33-srv04 #eu-west0-b - v3bf33-srv07 
#eu-west0-c - v3bf33-srv02 #eu-west0-a - v3bf33-srv05 #eu-west0-b 

any help is welcome. ^^

-- 
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 the web visit 
https://groups.google.com/d/msgid/ansible-project/0a850eb6-f7ce-48e9-bfcf-2796b978c9d4n%40googlegroups.com.


[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 process the start date and end 
date variable in order to launch a task at that moment?

I use AWX in parallel to launch my playbook once a day.

Do you have any ideas?

Thank you!

Translated with www.DeepL.com/Translator (free version)

-- 
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 the web visit 
https://groups.google.com/d/msgid/ansible-project/0ee7e498-5967-46fd-9a0a-4a2e721baafan%40googlegroups.com.