Re: [ansible-project] Issue creating symbolic link

2024-01-11 Thread harry devine
Got it! That cleared up my confusion and it's working now. I.appreciate you guys setting me straight! Thanks, Harry On Thu, Jan 11, 2024, 3:17 PM Dick Visser wrote: > > > On Thu, 11 Jan 2024 at 20:50, Todd Lewis wrote: > >> dest: "{{ '/usr/share/' + guacamole_tomcat + >>

Re: [ansible-project] Retrieving items from a dictionary

2023-09-28 Thread harry devine
Thank you Vladimir! I had already gotten the selectattr piece working but the length check was the missing piece. All good now. Thanks, Harry On Wed, Sep 27, 2023, 3:32 PM Vladimir Botka wrote: > Map the attribute > > dn: "{{ ansible_mounts| > selectattr('device', 'contains',

Re: [ansible-project] Re: Accessing contents of a fact in a loop

2021-12-03 Thread harry devine
I set it as a fact using your suggestion: user_find.json.result.result|map(attribute='uid')|flatten Harry On Fri, Dec 3, 2021, 5:08 PM Todd Lewis wrote: > I don't see where you're setting uid, the debug step, or its output. All I > see is that > >loop: > - "{{ uid }}" > > is only

Re: [ansible-project] Cannot source /etc/lsb-release

2021-09-27 Thread harry devine
You should use the full path to the source executable. "which source" should give you that. Harry On Mon, Sep 27, 2021, 1:04 PM 'Neil Young' via Ansible Project < ansible-project@googlegroups.com> wrote: > Hi, > > I'm banging my head trying to make this simple statement work: > > - name: Get

Re: [ansible-project] Generating Report After Executing Playbook Tasks

2021-01-08 Thread harry devine
I've done this by using a template. But I don't have access to my work system to get you an example. I can get one later or over the weekend if you'd like. Harry On Fri, Jan 8, 2021, 6:27 PM aksain bhati wrote: > That make sense but still any suggestion on generating report > > > On Saturday,

Re: [ansible-project] Date in a Jinja template

2020-12-08 Thread harry devine
Thank you! That worked very well. Harry On Tue, Dec 8, 2020, 9:49 AM Dick Visser wrote: > I think now() is naive, i.e. it does not know about time zones. > If you need time zones, then I'd give 'ansible_date_time' a try. > > On Tue, 8 Dec 2020 at 15:20, lift...@gmail.com wrote: > > > > I

Re: [ansible-project] Using 2 different users in one playbook

2020-12-02 Thread harry devine
Didn't work. I get "incorrect su password " still. Harry On Wed, Dec 2, 2020, 11:38 AM Daniel Caillibaud wrote: > Le 02/12/20 à 6h39, "lift...@gmail.com" a écrit : > > We have a playbook we're trying to implement that will stop an Oracle > > database via a script, reboot the server, then

Re: [ansible-project] Stripping YAML dashes from output

2020-11-13 Thread harry devine
: > On 11/13/20 6:28 PM, harry devine wrote: > > So how do I get rid of the u? What I ultimately wanted was JUST the > email addresses. > > > > Harry > > Join the list members into a string: | join('\n') > > Regards > Racke > > > > > On Fri

Re: [ansible-project] Stripping YAML dashes from output

2020-11-13 Thread harry devine
So how do I get rid of the u? What I ultimately wanted was JUST the email addresses. Harry On Fri, Nov 13, 2020, 12:15 PM Dick Visser wrote: > This is a simple list, which is what you wanted. > > On Fri, 13 Nov 2020 at 17:28, lift...@gmail.com > wrote: > > > > So now I'm getting this: > > >

[ansible-project] Re: Using fact as loop control in Jinja2 template

2020-06-23 Thread harry devine
Perfect Exactly what I needed. Thank you very much! Harry On Tuesday, June 23, 2020 at 2:52:38 PM UTC-4, harry devine wrote: > > I have a playbook that will use the user_find API call against our FreeIPA > server to retrieve a list of all users. What I'm trying to do is get the

[ansible-project] Re: Using fact as loop control in Jinja2 template

2020-06-23 Thread harry devine
, but the values appear to be in (what I think) is the json format. For example: [u'name1'],[u''] How do I strip out the "u'" and have just: name, Thanks, Harry On Tuesday, June 23, 2020 at 2:52:38 PM UTC-4, harry devine wrote: > > I have a playbook that will use the user_find API

[ansible-project] Using fact as loop control in Jinja2 template

2020-06-23 Thread harry devine
I have a playbook that will use the user_find API call against our FreeIPA server to retrieve a list of all users. What I'm trying to do is get the total count, then use that count in my j2 file. I'm getting the count as follows: - name: Set IDM facts set_fact: idmcount:

[ansible-project] Running Ruby 2.6 from /etc/profile.d via Ansible Playbook in RHEL 7

2020-06-04 Thread harry devine
I have a role I'm testing that will install Redmine (www.redmine.org) on to a RHEL 7.8 machine. Redmine requires Ruby >= 2.3. So I'm installing Ruby 2.6.2 via the rhel-server-rhscl-7-rpms repository. If I log into the machine manually and check the Ruby version, its 2.6.2. However, when I

Re: [ansible-project] loop query

2020-05-30 Thread harry devine
I think you should have: dev: “{{ item}}” loop: - /dev/sda1 Harry On Sat, May 30, 2020 at 1:17 PM Kannappan M wrote: > Hi Team, > > Recently i came to know that with.list is getting retired , so > what it is the replacement of it. > > For eg using the filesystem module i

Re: [ansible-project] installing windows updates on windows hosts

2020-05-13 Thread harry devine
Your “hosts” line needs to be before the - name line. Harry On Wed, May 13, 2020 at 6:37 PM Tony Wong wrote: > --- > - name: Install all critical and security updates > hosts: all > win_updates: > category_names: > - CriticalUpdates > - SecurityUpdates > state: installed >

[ansible-project] Re: Adding task output to a file in a loop

2020-05-13 Thread harry devine
** ldap : ok=0changed=0unreachable=0failed=1skipped=2 rescued=0ignored=0 Any thoughts/ideas? Thanks, Harry On Wednesday, May 6, 2020 at 3:41:55 PM UTC-4, harry devine wrote: > > I have a shell script that I'm trying to convert to Ansible. It currently > is similar

Re: [ansible-project] Adding task output to a file in a loop

2020-05-07 Thread harry devine
Each time through the loop, will the registered output overwrite the previous values? Harry On Wed, May 6, 2020 at 11:51 PM Brian Coca wrote: > I would use a template , you can use the registered results in a for > loop inside jinja2. > > > > -- > -- > Brian Coca > > -- > You

[ansible-project] Adding task output to a file in a loop

2020-05-06 Thread harry devine
I have a shell script that I'm trying to convert to Ansible. It currently is similar to the following: for uid in {1000..6500} user = ipa user-find --uid=$uid --raw |grep uid: | awk '{print $2}' echo "user,uid" >> uid.csv do How do I accomplish this in Ansible? I know I can use the shell

[ansible-project] Iterating ansible_mounts and adding items to a list

2020-04-13 Thread harry devine
I'm trying to come up a way to iterate through ansible_mounts and, if one of the mounts is over 80% used, add that to a list that i can print out later and possibly email it. Here's what I have so far: --- - hosts: localhost gather_facts: no become: yes become_method: sudo pre_tasks:

[ansible-project] Unexpected parameter type in new Ansible role

2020-03-09 Thread harry devine
I'm trying to create a role that will update Satellite content views using the Foreman/Katello modules. Here's what the role tree looks like: [root@server1 /etc/ansible/roles/foreman_content_views]#tree . ├── defaults │ └── main.yml ├── tasks │ ├── clean_cv.yml │ └── main.yml └── vars

Re: [ansible-project] Sum a list of items received

2020-03-03 Thread harry devine
a time. But that's another topic that I won't go into here. Yet. Thanks, Harry On Tuesday, March 3, 2020 at 9:14:34 AM UTC-5, harry devine wrote: > > My system is RHEL 7.7. The version of jinja2 is 2.7.2 and there isn't a > newer version available: > > [root@server1 ~]#rpm -qa py

Re: [ansible-project] Sum a list of items received

2020-03-03 Thread harry devine
My system is RHEL 7.7. The version of jinja2 is 2.7.2 and there isn't a newer version available: [root@server1 ~]#rpm -qa python-jinja2 python-jinja2-2.7.2-4.el7.noarch Harry On Tuesday, March 3, 2020 at 8:38:23 AM UTC-5, Felix Fontein wrote: > > Hi, > > > Well, I'm obviously completely

Re: [ansible-project] Sum a list of items received

2020-03-03 Thread harry devine
gt; > On Mon, Mar 02, 2020 at 01:26:28PM -0800, harry devine wrote: > > Is there a "not equal to" jinja filter? All of the documentation I find > > shows there's an 'equalto' but I can't seem to find any "no equalto" > > equivalent. Even a greater

Re: [ansible-project] Sum a list of items received

2020-03-02 Thread harry devine
heal_status.glusterfs.heal_info | > selectattr('no_of_entries','ne','0') | list | count == 0 > retries: 5 > delay: 10 > > Hopefully this is helpful. > -Daniel > > On Mon, Mar 2, 2020 at 9:30 AM harry devine > wrote: > >> >> >> On Thursday, F

Re: [ansible-project] Sum a list of items received

2020-03-02 Thread harry devine
On Thursday, February 27, 2020 at 1:44:39 PM UTC-5, harry devine wrote: > > Hey Daniel! This stem from ticket #02582900. Since the stance from > Support is “we don’t debug playbooks”, I care here. > > Their suggestion was to make sure that no healing operation was going on,

Re: [ansible-project] Sum a list of items received

2020-02-27 Thread harry devine
ried this nor ever used the module. I also realize it doesn't address the > question you asked, but you should be used to that from me at this point. :) > -Daniel > > > On Thu, Feb 27, 2020 at 9:38 AM harry devine wrote: > >> I'm using the gluster_heal_info module to che

[ansible-project] Sum a list of items received

2020-02-27 Thread harry devine
I'm using the gluster_heal_info module to check the heal status of a gluster volume. What I'd like to do is gather the "no_of_entries" parameter, sum them up, and it if it is 0, move to the next step of stopping gluster on that server, update it, and restart the service. The playbook below

Re: [ansible-project] Templating error with Ansible 2.9 or higher

2020-02-24 Thread harry devine
erver : ok=45 changed=2unreachable=0failed=1 skipped=28 rescued=0ignored=0 Thanks, Harry On Friday, February 21, 2020 at 5:42:04 PM UTC-5, Hugo Gonzalez wrote: > > > > On 2/19/20 8:02 AM, harry devine wrote: > > I'm using the Satellite6 Content Views role

[ansible-project] Templating error with Ansible 2.9 or higher

2020-02-19 Thread harry devine
I'm using the Satellite6 Content Views role found here: https://galaxy.ansible.com/ahuffman/satellite6_manage_content_views. It works on Ansible up to 2.8.6, but any version after that gives the following error: TASK [satellite6_manage_content_views : Set content view remove list]

[ansible-project] Re: Sending output from a completed job via the mail module

2019-09-05 Thread harry devine
I'll admit, this playbook is running in Ansible Tower, which is where I'm getting tower_id from. I know that I could reach out to Red Hat for Tower questions, but in the past I've had them reject my support requests for these types of questions. They say that they don't support with any

[ansible-project] Sending output from a completed job via the mail module

2019-09-05 Thread harry devine
We have a playbook where, once its completed, we'd like to email the stdout to certain users. Right now I am testing with the command module in the playbook as follows: - name: Get job output command: curl -k -u admin:{{ tower_pass }} -X GET https:///api/v2/jobs/{{ tower_id }}/stdout/

[ansible-project] Attaching/detaching storage domains

2019-08-27 Thread harry devine
We have a Red Hat RHV setup that uses NFS for its storage. We are moving to a Red Hat Hyperconverged solution that uses GlusterFS for its storage. We have a Data domain called Migrate that we use to move the VM disks from the NFS storage domain to this NFS migrate domain. What we'd like to

[ansible-project] Re: Erroneous playbook failure

2019-08-14 Thread harry devine
Anyone have any ideas? On Monday, August 12, 2019 at 7:40:28 AM UTC-4, harry devine wrote: > > We have a playbook that runs every night that will do a "yum update" on > all of our servers, then performs an "aide --update" to keep AIDE up to > date. Wheneve

[ansible-project] Erroneous playbook failure

2019-08-12 Thread harry devine
We have a playbook that runs every night that will do a "yum update" on all of our servers, then performs an "aide --update" to keep AIDE up to date. Whenever a difference is found, Ansible flags it as a fatal error. The msg is "non zero return code" and the rc value is 7. Here'a sample of