Refactor Ansible tasks to use fully qualified module names and improve code consistency
- Updated all tasks to use fully qualified module names (e.g., ansible.builtin.shell, ansible.builtin.copy) for clarity and to avoid ambiguity. - Replaced deprecated 'yum' module with 'dnf' for package management on RedHat-based systems. - Improved formatting and consistency in task definitions, including the use of double quotes for strings and consistent indentation. - Removed unnecessary comments and whitespace to enhance readability. - Ensured that conditions and loops are consistently formatted across all tasks.
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
---
|
||||
|
||||
- name: (tor.yml) Ensure tor is installed.
|
||||
apt:
|
||||
ansible.builtin.apt:
|
||||
name:
|
||||
- tor
|
||||
state: present
|
||||
@@ -10,23 +9,21 @@
|
||||
tags:
|
||||
- tor-service
|
||||
|
||||
|
||||
- name: (tor.yml) Ensure tor servive is enabled and started
|
||||
service:
|
||||
- name: (tor.yml) Ensure tor servive is enabled and started
|
||||
ansible.builtin.service:
|
||||
name: tor
|
||||
enabled: yes
|
||||
enabled: true
|
||||
state: started
|
||||
tags:
|
||||
- tor-service
|
||||
|
||||
|
||||
- name: (tor.yml) Adjust configuration /etc/tor/torrc using template torrc.j2
|
||||
template:
|
||||
ansible.builtin.template:
|
||||
src: etc/tor/torrc.j2
|
||||
dest: '{{ torrc_path }}'
|
||||
dest: "{{ torrc_path }}"
|
||||
owner: root
|
||||
group: root
|
||||
mode: '0644'
|
||||
mode: "0644"
|
||||
notify: "Restart tor service"
|
||||
when:
|
||||
- torrc_path is defined
|
||||
|
||||
Reference in New Issue
Block a user