RE: [EXTERNAL] [ansible-project] Re: Regarding No space left on device error

2024-01-19 Thread 'Hearn, Stan J.' via Ansible Project
That's a great point Todd. If the TARGET is Linux, run this and look for 'ro' read-only or 'rw' read-write. ansible 'TARGET' -m shell -a 'cat /proc/mounts | grep "/home "' From: ansible-project@googlegroups.com On Behalf Of Todd Lewis Sent: Friday, January 19, 2024 11:40 AM To: Ansible Project

[ansible-project] "Pythonism" filters

2023-09-12 Thread 'Hearn, Stan J.' via Ansible Project
What are some good resources to learn Ansible "pythonism" filters? I struggle with string manipulation, sets, dict merging, etc. In my opinion this is one of the greatest strengths of Ansible. How did you guys learn it? Did you learn it because you knew python first? Regards, Stan -- You r

RE: [EXTERNAL] Re: [ansible-project] edit string in a multi-line file

2023-07-27 Thread 'Hearn, Stan J.' via Ansible Project
What you want to use is backrefs. https://docs.ansible.com/ansible/latest/collections/ansible/builtin/lineinfile_module.html An Example from the document: # NOTE: Yaml requires escaping backslashes in double quotes but not in single quotes - name: Ensure the JBoss memory settings are exactly as

RE: [EXTERNAL] [ansible-project] creating a csv for a package existing or not existing on remotes

2023-06-06 Thread 'Hearn, Stan J.' via Ansible Project
You can use package facts. - name: Gather the rpm package_facts package_facts: manager: auto - name: do something if package not installed debug: msg: 'hey package is not installed' when: "''MyPackage'' not in ansible_facts.packages" - name: do something

RE: [EXTERNAL] [ansible-project] unreachable and retries

2023-03-20 Thread 'Hearn, Stan J.' via Ansible Project
I've found that if you have an unreliable connection to a target, you have at least two challenges. One is Ansible and another is the package repo connection instability.Sometimes they both recover or finish and sometimes they don't. - create an execution environment ansible control node n

[ansible-project] conditional statements should not include jinja2 templating delimiters

2023-03-03 Thread 'Hearn, Stan J.' via Ansible Project
I have this when clause that contains a variable named agent_host and I can't determine how to rewrite it to remove the mustaches. The logic works, however I get the warning. when: "'Linked to: {{ agent_host }}' not in nessus_link_status.stdout" [WARNING]: conditional statements should not

RE: [ansible-project] split with multiple columns in debug

2023-02-27 Thread 'Hearn, Stan J.' via Ansible Project
Veera, Be careful splitting uptime on white space because when a system is up less than 24 hours, it will show 12:58:10 up 6:51, 0 users, load average: 1.08, 0.99, 1.05 which will have one less white space and your desired output will be position 6. I would recommend splitting the output on

RE: [EXTERNAL] [ansible-project] Error odule fetch dest is an existing directory

2022-12-16 Thread 'Hearn, Stan J.' via Ansible Project
local_user.stdout is a directory that exists. Do you want to replace the directory with a file named file.bz2? If you are wanting to put the file inside the directory, then add a slash to {{ local_user.stdout }}_SLASH_ dest: "/home/{{ local_user.stdout }}/" Regards, Stan From: ansib

RE: [ansible-project] Complex lineinfile/replace

2022-11-01 Thread 'Hearn, Stan J.' via Ansible Project
;\g<1> 1 2" Walter -- Walter Rowe, Division Chief Infrastructure Services, OISM Mobile: 202.355.4123 On Nov 1, 2022, at 2:36 PM, 'Hearn, Stan J.' via Ansible Project mailto:ansible-project@googlegroups.com>> wrote: It needs to be 'whitespace'ext4'whitespa

RE: [ansible-project] Complex lineinfile/replace

2022-11-01 Thread &#x27;Hearn, Stan J.&#x27; via Ansible Project
It needs to be 'whitespace'ext4'whitespace' unless you want to change mount points that might contain the letters ext4. Are you sure you want to change the root filesystem to '1 2' Man Page: The root filesystem should be specified with a fs_passno of 1 Regards, Stan From: 'Rowe, Walter P. (Fed

RE: [EXTERNAL] [ansible-project] Playbook output to markdown?

2022-09-13 Thread &#x27;Hearn, Stan J.&#x27; via Ansible Project
You didn't mention awx or Ansible Automation, so I assume you are using command line. ansible-playbook someplay.yml | sed -n '/PLAY RECAP /,$p' | egrep 'failed=[1-9]' sed - only print the lines from "PLAY RECAP " top the end. egrep - only print lines that contain "failed=" with a non zero first

RE: [ansible-project] create a systemd service without write access to /etc/systemd/system

2022-09-01 Thread &#x27;Hearn, Stan J.&#x27; via Ansible Project
The sudo privileges granted to "remote_user" needs be to be limitless. Execute ALL commands as ALL users. One cannot restrict to executing a single binary like 'useradd' because it's running a module with a random name. It's either all or nothing. Regards, Stan From: 'Rowe, Walter P. (Fed)

RE: [EXTERNAL] Re: [ansible-project] trying to modify line in yaml file spaces

2022-05-12 Thread &#x27;Hearn, Stan J.&#x27; via Ansible Project
I agree that it would better to manage state not contents of the file. I suggest having multiple docker compose files each pointing to the jenkins version and use Ansible to change symbolic links to the one you desire. A list of files would be docker-compose-jenkins:2.232.1 docker-compose-jenkin