Skip to content

Commit

Permalink
🔧 chore(ansible-lint.yml): удалить yaml[octal-values] из skip_list (#373
Browse files Browse the repository at this point in the history


✨ feat(ansible roles): wrap mode values in quotes to improve readability and consistency
The yaml[octal-values] rule was removed from the skip_list in the ansible-lint.yml file. The mode values in the ansible roles were wrapped in quotes to improve readability and consistency.

🐛 fix(roles): wrap mode values in quotes to avoid Ansible warnings
The mode values in the Ansible tasks were wrapped in quotes to avoid warnings from Ansible. This is a minor fix that improves the readability of the code and ensures that the tasks run without warnings.

🐛 fix(main.yml): wrap mode values in quotes to avoid Ansible deprecation warning
The mode values in the Ansible tasks were wrapped in quotes to avoid deprecation warnings. This is a minor fix that ensures the playbook runs without warnings.
  • Loading branch information
ThomasSanson authored Jun 10, 2023
1 parent 6f4fe12 commit 4f46f57
Show file tree
Hide file tree
Showing 30 changed files with 75 additions and 76 deletions.
1 change: 0 additions & 1 deletion .config/ansible-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ skip_list:
- run-once[task]
- schema[tasks]
- yaml[line-length]
- yaml[octal-values]
- yaml[trailing-spaces]
- yaml[truthy]

Expand Down
6 changes: 3 additions & 3 deletions roles/ansible-role-firewall/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
dest: /etc/firewall.bash
owner: root
group: root
mode: 0744
mode: "0744"
notify: restart firewall

- name: Copy firewall init script into place.
Expand All @@ -29,7 +29,7 @@
dest: /etc/init.d/firewall
owner: root
group: root
mode: 0755
mode: "0755"
when: "ansible_service_mgr != 'systemd'"

- name: Copy firewall systemd unit file into place (for systemd systems).
Expand All @@ -38,7 +38,7 @@
dest: /etc/systemd/system/firewall.service
owner: root
group: root
mode: 0644
mode: "0644"
when: "ansible_service_mgr == 'systemd'"

# prevents firewall initialization from severing the SSH connection
Expand Down
2 changes: 1 addition & 1 deletion roles/consul/tasks/acl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
dest: "{{ consul_configd_path }}/50acl_policy.hcl"
owner: "{{ consul_user }}"
group: "{{ consul_group }}"
mode: 0600
mode: "0600"
notify:
- restart consul
when: consul_acl_policy | bool
4 changes: 2 additions & 2 deletions roles/consul/tasks/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
owner: "{{ consul_user }}"
group: "{{ consul_group }}"
content: "{{ lookup('template', consul_config_template_path, convert_data=True) | to_nice_json }}"
mode: 0600
mode: "0600"
with_items:
- dest: "{{ consul_config_path }}/config.json"
config_version: "{{ consul_node_role }}"
Expand All @@ -34,7 +34,7 @@
owner: "{{ consul_user }}"
group: "{{ consul_group }}"
content: "{{ lookup('template', 'templates/configd_50custom.json.j2', convert_data=True) | to_nice_json }}"
mode: 0600
mode: "0600"
when:
- consul_config_custom is defined
notify:
Expand Down
10 changes: 5 additions & 5 deletions roles/consul/tasks/dirs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
state: directory
owner: "{{ consul_user }}"
group: "{{ consul_group }}"
mode: 0700
mode: "0700"
with_items:
- "{{ consul_config_path }}"
- "{{ consul_configd_path }}"
Expand All @@ -23,7 +23,7 @@
state: directory
owner: "{{ consul_user }}"
group: "{{ consul_group }}"
mode: 0750
mode: "0750"
when: not consul_install_from_repo | bool

- name: Create log directory
Expand All @@ -32,7 +32,7 @@
state: directory
owner: "{{ consul_user }}"
group: "{{ consul_group }}"
mode: 0700
mode: "0700"
when:
- ansible_os_family != 'Windows'
- not consul_syslog_enable | bool
Expand All @@ -44,7 +44,7 @@
state: directory
owner: "{{ syslog_user }}"
group: "{{ syslog_group }}"
mode: 0700
mode: "0700"
with_items:
- "{{ consul_log_path }}"
loop_control:
Expand All @@ -59,7 +59,7 @@
path: "{{ consul_bin_path }}"
state: directory
owner: root
mode: 0755
mode: "0755"
when:
# On macOS, we should not alter consul_bin_path, since it may be owned by the homebrew
# user. This may cause the role to fail on macOS systems where homebrew is not
Expand Down
4 changes: 2 additions & 2 deletions roles/consul/tasks/dnsmasq.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
state: directory
owner: root
group: wheel
mode: 0700
mode: "0700"
become: true
when: ansible_os_family == "FreeBSD"
tags: dnsmasq
Expand All @@ -38,7 +38,7 @@
dest: "{{ dnsmasq_item.dest }}"
owner: root
group: "{{ dnsmasq_item.group }}"
mode: 0644
mode: "0644"
become: true
notify: restart dnsmasq
when: dnsmasq_item.when
Expand Down
2 changes: 1 addition & 1 deletion roles/consul/tasks/encrypt_gossip.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
copy:
content: "{{ consul_raw_key }}"
dest: /tmp/consul_raw.key
mode: 0600
mode: "0600"
become: false
vars:
ansible_become: false
Expand Down
2 changes: 1 addition & 1 deletion roles/consul/tasks/install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@
dest: "{{ consul_bin_path }}/consul"
owner: "{{ consul_user }}"
group: "{{ consul_group }}"
mode: 0755
mode: "0755"
notify:
- restart consul
- reload systemd daemon
Expand Down
2 changes: 1 addition & 1 deletion roles/consul/tasks/install_linux_repo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@
dest: /etc/systemd/system/consul.service.d/override.conf
owner: root
group: root
mode: 0644
mode: "0644"
register: systemd_override
become: true
notify:
Expand Down
2 changes: 1 addition & 1 deletion roles/consul/tasks/install_remote.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
dest: "{{ consul_bin_path }}"
owner: "{{ consul_user }}"
group: "{{ consul_group }}"
mode: 0755
mode: "0755"
register: consul_install
notify:
- restart consul
Expand Down
14 changes: 7 additions & 7 deletions roles/consul/tasks/nix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@
copy:
content: "{{ consul_raw_key }}"
dest: '/tmp/consul_raw.key'
mode: 0600
mode: "0600"
become: false
vars:
ansible_become: false
Expand Down Expand Up @@ -176,7 +176,7 @@
dest: /etc/rc.d/consul
owner: root
group: wheel
mode: 0755
mode: "0755"
when: ansible_os_family == "FreeBSD"

- name: Create SYSV init script
Expand All @@ -185,7 +185,7 @@
dest: /etc/init.d/consul
owner: root
group: root
mode: 0755
mode: "0755"
when:
- not ansible_service_mgr == "systemd"
- not ansible_os_family == "Debian"
Expand All @@ -199,7 +199,7 @@
dest: /etc/init.d/consul
owner: root
group: root
mode: 0755
mode: "0755"
when:
- not ansible_service_mgr == "systemd"
- ansible_os_family == "Debian"
Expand All @@ -213,7 +213,7 @@
dest: "{{ consul_systemd_unit_path }}/consul.service"
owner: root
group: root
mode: 0644
mode: "0644"
register: systemd_unit
notify: restart consul
when:
Expand Down Expand Up @@ -253,7 +253,7 @@
dest: "{{ consul_smf_manifest }}"
owner: root
group: root
mode: 0644
mode: "0644"
when: ansible_os_family == "Solaris"
register: smfmanifest

Expand Down Expand Up @@ -304,7 +304,7 @@
file:
dest: "{{ consul_bootstrap_state }}"
state: touch
mode: 0600
mode: "0600"

- include_tasks: ../tasks/iptables.yml
when: consul_iptables_enable | bool
Expand Down
2 changes: 1 addition & 1 deletion roles/consul/tasks/services.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
src: service.json.j2
owner: "{{ consul_user }}"
group: "{{ consul_group }}"
mode: 0644
mode: "0644"
with_items: "{{ consul_services }}"
loop_control:
loop_var: service_item
Expand Down
6 changes: 3 additions & 3 deletions roles/consul/tasks/snapshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
dest: /lib/systemd/system/consul_snapshot.service
owner: root
group: root
mode: 0644
mode: "0644"
register: systemd_unit
notify: start snapshot
when:
Expand All @@ -31,7 +31,7 @@
dest: "{{ consul_config_path }}/consul_snapshot.json"
owner: "{{ consul_user }}"
group: "{{ consul_group }}"
mode: 0644
mode: "0644"
notify: start snapshot
when:
- ansible_service_mgr == "systemd"
Expand All @@ -50,4 +50,4 @@
path: "{{ consul_snapshot_storage }}"
owner: "{{ consul_user }}"
group: "{{ consul_group }}"
mode: 0744
mode: "0744"
4 changes: 2 additions & 2 deletions roles/consul/tasks/syslog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
dest: /etc/syslog-ng/conf.d/consul.conf
owner: root
group: root
mode: 0444
mode: "0444"
when:
- ansible_os_family != 'Windows'
- consul_syslog_enable | bool
Expand All @@ -31,7 +31,7 @@
dest: /etc/rsyslog.d/00-consul.conf
owner: root
group: root
mode: 0444
mode: "0444"
when:
- ansible_os_family != 'Windows'
- consul_syslog_enable | bool
Expand Down
8 changes: 4 additions & 4 deletions roles/consul/tasks/tls.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
state: directory
owner: "{{ consul_user }}"
group: "{{ consul_group }}"
mode: 0755
mode: "0755"

- name: Copy CA certificate
copy:
Expand All @@ -17,7 +17,7 @@
dest: "{{ consul_tls_dir }}/{{ consul_tls_ca_crt | basename }}"
owner: "{{ consul_user }}"
group: "{{ consul_group }}"
mode: 0644
mode: "0644"
notify: restart consul

when:
Expand All @@ -31,7 +31,7 @@
dest: "{{ consul_tls_dir }}/{{ consul_tls_server_crt | basename }}"
owner: "{{ consul_user }}"
group: "{{ consul_group }}"
mode: 0644
mode: "0644"
notify: restart consul

- name: Copy server key
Expand All @@ -41,7 +41,7 @@
dest: "{{ consul_tls_dir }}/{{ consul_tls_server_key | basename }}"
owner: "{{ consul_user }}"
group: "{{ consul_group }}"
mode: 0600
mode: "0600"
notify: restart consul

when:
Expand Down
4 changes: 2 additions & 2 deletions roles/consul/tasks/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
copy:
content: "{{ consul_raw_key }}"
dest: '/tmp/consul_raw.key'
mode: 0600
mode: "0600"
become: false
vars:
ansible_become: false
Expand All @@ -101,7 +101,7 @@
copy:
content: "{{ consul_keygen.stdout }}"
dest: '/tmp/consul_raw.key'
mode: 0600
mode: "0600"
become: false
vars:
ansible_become: false
Expand Down
2 changes: 1 addition & 1 deletion roles/etcd/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
path: "{{ etcd_data_dir }}"
state: directory
owner: etcd
mode: 0700
mode: "0700"
tags: etcd, etcd_conf

- name: Generate conf file "/etc/etcd/etcd.conf"
Expand Down
2 changes: 1 addition & 1 deletion roles/keepalived/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
dest: /usr/libexec/keepalived/haproxy_check.sh
owner: root
group: root
mode: 0700
mode: "0700"
notify: "restart keepalived"
tags: keepalived_conf, keepalived

Expand Down
8 changes: 4 additions & 4 deletions roles/patroni/config/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
state: directory
owner: postgres
group: postgres
mode: 0750
mode: "0750"
tags: patroni, patroni_conf

- name: Make sure that patroni log directory exists
Expand All @@ -16,7 +16,7 @@
owner: postgres
group: postgres
state: directory
mode: 0750
mode: "0750"
when: patroni_log_destination == 'logfile'
tags: patroni

Expand All @@ -26,7 +26,7 @@
owner: postgres
group: postgres
state: directory
mode: 0700
mode: "0700"
tags: patroni

- name: Update conf file "/etc/patroni/patroni.yml"
Expand All @@ -35,7 +35,7 @@
dest: /etc/patroni/patroni.yml
owner: postgres
group: postgres
mode: 0640
mode: "0640"
notify: "reload patroni"
tags: patroni, patroni_conf

Expand Down
2 changes: 1 addition & 1 deletion roles/patroni/config/tasks/pg_hba.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
dest: "{{ postgresql_conf_dir }}/pg_hba.conf"
owner: postgres
group: postgres
mode: 0640
mode: "0640"
notify: "reload postgres"
tags: pg_hba, pg_hba_generate
...
Loading

0 comments on commit 4f46f57

Please sign in to comment.