[ansible-project] Re: Fetch rootdse from LDAP server

2021-08-20 Thread 'Mark Tovey' via Ansible Project
I found the answer: ansible localhost -m community.general.ldap_search -a "server_uri='ldap://myldapserver.example.com' validate_certs=false bind_dn='' dn='' scope=base attrs=defaultnamingcontext" localhost | SUCCESS => { "changed": false, "results": [ {

[ansible-project] Fetch rootdse from LDAP server

2021-08-19 Thread 'Mark Tovey' via Ansible Project
I am trying to use community.general.ldap_search to return the RootDSE from a LDAP server (RedHat Directory Server). The LDAP server is configured to allow anonymous access to the RootDSE (nsslapd-allow-anonymous-access: rootdse) and I can retrieve it with ldapsearch: ldapsearch -LLL -x -H

Re: [ansible-project] Determine last host in host list

2021-01-19 Thread 'Mark Tovey' via Ansible Project
n Mon, 18 Jan 2021 11:32:05 -0800 (PST) >> > "'Mark Tovey' via Ansible Project" >> > wrote: >> > >> > > I need to determine how many hosts are left to be worked on in a >> playbook >> > > run. I have set serial to 1 in the

[ansible-project] Determine last host in host list

2021-01-18 Thread 'Mark Tovey' via Ansible Project
I need to determine how many hosts are left to be worked on in a playbook run. I have set serial to 1 in the playbook so only one host will be worked on at a time, and I have a long pause at the bottom of the playbook to force a settling period between hosts. But if the current host is the

Re: [ansible-project] group_by with random key values

2020-06-12 Thread 'Mark Tovey' via Ansible Project
Unfortunately, I am under the constraint that I must use the password store that the company has chosen to use (Passwordstate). I have that part working fine. I am able to push passwords into it and pull them back out with no problem. But the general structure of your code will probably be

[ansible-project] group_by with random key values

2020-06-11 Thread 'Mark Tovey' via Ansible Project
I am trying to develop a playbook to set a common password on groups of servers. The concept is that all servers within a given group would receive one randomly generated password, all servers within the next group would receive a different randomly generated password, and so on. The issue

[ansible-project] Export environment variables

2020-01-06 Thread 'Mark Tovey' via Ansible Project
I need to export some environment variables before running a task, but it appears that setting variables with "environment" does not export them; they remain local. For test, I wrote the following simple playbook: --- - hosts: localhost gather_facts: no environment: MYVAR: "TEST1"

[ansible-project] Ansible is totally broken after a OS upgrade

2019-10-28 Thread 'Mark Tovey' via Ansible Project
I just performed a OS upgrade on our Ansible server from RedHat 7.6 to RedHat 7.7, and now Ansible has become unusable. When I try to run any task that uses any Ansible fact, I get the following error: [WARNING]: Failure using method (v2_runner_on_ok) in callback plugin (): value must

[ansible-project] More dynamic variables

2019-08-21 Thread 'Mark Tovey' via Ansible Project
I hate having to constantly go here to solve issues like this, especially when the issues I keep presenting are all so similar, but eventually I have to just give up trying to solve this on my own and ask. I want to define a structure in a vars file that looks like the following:

[ansible-project] Yet another dynamic variable problem

2019-07-23 Thread 'Mark Tovey' via Ansible Project
I am trying to generate a variable name dynamically, but so far I have been stymied. I have lists whose names are based upon the OS name: myos7: - os7package1 - os7package2 - os7package3 myos8: - os8package1 - os8package2 - os8package3 I want to access these lists

[ansible-project] Create a variable that contains other variable values with labels

2019-05-02 Thread 'Mark Tovey' via Ansible Project
I have a list: list1 - value1 - value2 and I want to use set_fact create a new variable that contains these variables with a label in front of them, so that this debug task: - debug: msg: "{{var1}}" would result in output that looks like this: label value1

[ansible-project] Complex dictionary access

2019-04-25 Thread 'Mark Tovey' via Ansible Project
I have a dictionary structure that looks like the following: myservers: DC1: CORE: 10.10.10.20 DMZ: 10.10.20.20 DC2: CORE: 10.10.10.30.20 DMZ: 10.10.10.40.20 DC3: CORE: 10.10.50.20 DMZ: 10.10.60.20 DC4: CORE: 10.10.70.20 DMZ: 10.10.80.20 And another dictionary that

[ansible-project] replace module cannot crashes when encountering Danish characters

2019-03-19 Thread 'Mark Tovey' via Ansible Project
I am working on a playbook to replace the comment field in a server's password file. I was trying to use the replace module to do this. But it began crashing on one server. By elimination I was able to isolate the problem to one user's account entry in the password file. The user is