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
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
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
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
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
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
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
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
;\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
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
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
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)
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
13 matches
Mail list logo