Re: [ansible-project] return code as the input value for another play

2021-03-23 Thread danish09
Thanks both. Using Tower, unfortunately, is not something that I can jump over to. Though, i might just give it a read. For now, I have just gone back to calling 2 separate playbooks individually. Thanks On Monday, 22 March 2021 at 15:32:25 UTC Brian Coca wrote: > Look at AWX/Tower workflows.

[ansible-project] Re: return code as the input value for another play

2021-03-21 Thread danish09
Thanks On Sunday, 21 March 2021 at 11:50:11 UTC danish09 wrote: > Hi, > > My goal is to implement 2 separate playbooks from the root main.yml, > however, I would like to execute the 2nd playbook only when the 1st gives a > return code of 0. > > --- > - hosts: a

[ansible-project] return code as the input value for another play

2021-03-21 Thread danish09
Hi, My goal is to implement 2 separate playbooks from the root main.yml, however, I would like to execute the 2nd playbook only when the 1st gives a return code of 0. --- - hosts: all - import_playbook: sftp.yml - import_playbook: reboot.yml --- - hosts: sftp01 tasks: - name: create

Re: [ansible-project] help: loop through a remote file

2021-03-06 Thread danish09
19:06:58 UTC dick@geant.org wrote: > Did you look at > > https://docs.ansible.com/ansible/latest/collections/ansible/builtin/getent_module.html > > ? > > On Fri, 5 Mar 2021 at 18:20, danish09 wrote: > >> Hi, >> >> Using ansible 2.4.0 on contr

[ansible-project] Re: escaping in a shell module

2021-03-06 Thread danish09
Thanks everyone, got this working. *awk -v LIMIT=$UGIDLIMIT -F':' '($3>=LIMIT) && ($3!=65534) && ($6=="/sftp")' /etc/passwd > /home/ /migrate/passwd.mig* On Saturday, 6 March 2021 at 12:18:16 UTC danish09 wrote: > Hi, >

[ansible-project] escaping in a shell module

2021-03-06 Thread danish09
Hi, ansible 2.4.0 remote environment: ubuntu 14.04 host/controller: Ubuntu 16.04.7 LTS I have a task to extract some usernames from the passwd file *- name: extract usernames from password file * * shell: "awk -v LIMIT=$UGIDLIMIT -F: '($3>=LIMIT) && ($3!=65534) && ($6="/sftp")' /etc/passwd > /

[ansible-project] help: loop through a remote file

2021-03-05 Thread danish09
Hi, Using ansible 2.4.0 on controller. Remote is an ubuntu 14.04 LTS. Python 2.7 I am trying to cat through passwd file, awk the first column, register that into a variable and then create a compressed archive of a remote dir based on that username. I have read about using lookups, simple sh

Re: [ansible-project] using regex in replace module

2018-12-14 Thread danish09
brilliant. thank you very much. finally seem to be making sense of regular expressions some what but still have a long way to go Thanks again. On Thursday, 13 December 2018 17:24:29 UTC, Dick Visser wrote: > > On Thu, 13 Dec 2018 at 17:42, danish09 > wrote: > > > >

Re: [ansible-project] using regex in replace module

2018-12-13 Thread danish09
p conf file and search and replace regex > replace: > path: /etc/nginx/sites-available/cruk-eb > regexp: '(privkey|cert)\.cruk\.org\.(key\.pem|crt)' > replace: '\g<1>3.pem' > backup: yes > > Dick >

[ansible-project] using regex in replace module

2018-12-13 Thread danish09
Hey there, I am using ansible 2.6.4. In on the projects I was working on, I had to search for 2 different words in the same file and replace them as necessary. Used *replace* module 2 times for this. Below is the playbook that I have used. - name: backup conf file and search and replace re

Re: [ansible-project] setting environment variables

2018-03-23 Thread danish09
Thank you very much. Your suggestion is working perfect. On Tuesday, 20 March 2018 15:27:33 UTC, danish09 wrote: > > Thank you for responding to me. I am stuck now at some silly mistake of > mine in that playbook. I will come back to your suggestion as soon as I > correct the error

[ansible-project] Failed to find handler for

2018-03-21 Thread danish09
When I am downloading a tar.gz file and unarchiving it using the unarchive module, ansible fails with "Failed to find handler for \"/usr/share/openjdk-9.0.4_linux-x64_bin.tar.gz\". Make sure the required command to extract the file is installed. Commands \"gtar\" and \"tar\" not found. Comman

[ansible-project] source archive succeeds however, downloading and unarchiving fails

2018-03-20 Thread danish09
Hi, Please provide your suggestions. Kindly help me on what mistake I am doing, ansible --version ansible 2.4.3.0 config file = None configured module search path = [u'/home/xx/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules'] ansible python module location = /usr/lo

Re: [ansible-project] setting environment variables

2018-03-20 Thread danish09
Thank you for responding to me. I am stuck now at some silly mistake of mine in that playbook. I will come back to your suggestion as soon as I correct the error. Thanks for your advise again. On Tuesday, 20 March 2018 13:31:36 UTC, Brian Coca wrote: > > as you have it there, the `environment`

[ansible-project] setting environment variables

2018-03-20 Thread danish09
Hi, I know the solution to this topic has been posted many times and I have tried searching through google and other forums including the ansible docs but unfortunately, nothing seems to be working for me. Please provide your feedback and help me with the solution. Also please let me know if yo