Skip to content

Commit

Permalink
Consistently resolve yamllint octal findings
Browse files Browse the repository at this point in the history
  • Loading branch information
davedittrich committed Nov 20, 2024
1 parent db3e513 commit b1e2c29
Show file tree
Hide file tree
Showing 32 changed files with 133 additions and 117 deletions.
4 changes: 3 additions & 1 deletion .yamllint
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,10 @@ rules:
new-line-at-end-of-file: disable
new-lines:
type: unix
# The following 'forbid-*' rules may not mean what you think they mean.
# See: https://yamllint.readthedocs.io/en/stable/rules.html#module-yamllint.rules.octal_values
octal-values:
forbid-explicit-octal: false
forbid-explicit-octal: true
forbid-implicit-octal: true
trailing-spaces: disable
truthy: disable
4 changes: 3 additions & 1 deletion molecule/branding/converge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@
content: |
{{ vars | to_yaml }}
dest: '{{ molecule_ephemeral_directory }}/ansible-vars.yml'
mode: 0o600
owner: 'root'
group: 'root'
mode: '0o600'
changed_when: false
delegate_to: localhost

Expand Down
4 changes: 3 additions & 1 deletion molecule/default/converge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@
content: |
{{ vars | to_yaml }}
dest: '{{ molecule_ephemeral_directory }}/ansible-vars.yml'
mode: 0o600
owner: 'root'
group: 'root'
mode: '0o600'
changed_when: false
delegate_to: localhost

Expand Down
4 changes: 3 additions & 1 deletion molecule/delegated/converge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@
content: |
{{ vars | to_yaml }}
dest: '{{ molecule_ephemeral_directory }}/ansible-vars.yml'
mode: 0o600
owner: 'root'
group: 'root'
mode: '0o600'
changed_when: false
delegate_to: localhost

Expand Down
4 changes: 3 additions & 1 deletion molecule/dropins/converge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@
content: |
{{ vars | to_yaml }}
dest: '{{ molecule_ephemeral_directory }}/ansible-vars.yml'
mode: 0o600
owner: 'root'
group: 'root'
mode: '0o600'
changed_when: false
delegate_to: localhost

Expand Down
4 changes: 3 additions & 1 deletion molecule/ip_in_issue/converge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@
content: |
{{ vars | to_yaml }}
dest: '{{ molecule_ephemeral_directory }}/ansible-vars.yml'
mode: 0o600
owner: 'root'
group: 'root'
mode: '0o600'
changed_when: false
delegate_to: localhost

Expand Down
4 changes: 3 additions & 1 deletion molecule/kali_like/converge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@
content: |
{{ vars | to_yaml }}
dest: '{{ molecule_ephemeral_directory }}/ansible-vars.yml'
mode: 0o600
owner: 'root'
group: 'root'
mode: '0o600'
changed_when: false
delegate_to: localhost

Expand Down
4 changes: 3 additions & 1 deletion molecule/kdmt/converge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@
content: |
{{ vars | to_yaml }}
dest: '{{ molecule_ephemeral_directory }}/ansible-vars.yml'
mode: 0o600
owner: 'root'
group: 'root'
mode: '0o600'
changed_when: false
delegate_to: localhost

Expand Down
14 changes: 7 additions & 7 deletions molecule/shared/prepare.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
ansible.builtin.copy:
src: 'config.txt'
dest: '/boot/config.txt'
owner: root
group: root
mode: 0o640
owner: 'root'
group: 'root'
mode: '0o640'
when: boot_config.stat.exists is false

- name: Stat `/boot/cmdline.txt` file.
Expand All @@ -31,9 +31,9 @@
ansible.builtin.copy:
src: 'cmdline.txt'
dest: '/boot/cmdline.txt'
owner: root
group: root
mode: 0o640
owner: 'root'
group: 'root'
mode: '0o640'
when: boot_cmdline.stat.exists is false

- name: Include account enumeration tasks.
Expand All @@ -45,7 +45,7 @@
state: directory
owner: '{{ user }}'
group: '{{ user }}'
mode: 0o700
mode: '0o700'
loop: '{{ accounts }}'
loop_control:
loop_var: user
Expand Down
6 changes: 3 additions & 3 deletions playbooks/install-zaproxy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,9 @@
ansible.builtin.copy:
src: '{{ zaproxy_deb_dir }}{{ zaproxy_deb }}'
dest: '/tmp//{{ zaproxy_deb }}'
owner: root
group: root
mode: 0o660
owner: 'root'
group: 'root'
mode: '0o660'
become: true

- name: Ensure zaproxy DEB is installed.
Expand Down
12 changes: 6 additions & 6 deletions roles/branding/tasks/boot_splash.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
state: present
owner: 'root'
group: 'root'
mode: 0o640
mode: '0o640'
become: true
when: branding__boot_config.stat.exists

Expand All @@ -31,7 +31,7 @@
state: absent
owner: 'root'
group: 'root'
mode: 0o640
mode: '0o640'
backup: false
become: true
check_mode: true
Expand All @@ -49,7 +49,7 @@
backup: false
owner: 'root'
group: 'root'
mode: 0o640
mode: '0o640'
become: true
when: branding__boot_cmdline.stat.exists and not branding__nologo_exists.found

Expand All @@ -76,9 +76,9 @@
ansible.builtin.template:
src: 'splashscreen.service.j2'
dest: '/lib/systemd/system/splashscreen.service'
owner: root
group: root
mode: 0o644
owner: 'root'
group: 'root'
mode: '0o644'
become: true
notify: Enable splashscreen

Expand Down
12 changes: 6 additions & 6 deletions roles/branding/tasks/check_custom_splash.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@
src: '/boot/custom-splash.jpg'
dest: '/root/custom-splash.jpg'
remote_src: true
owner: root
group: root
mode: 0o644
owner: 'root'
group: 'root'
mode: '0o644'

- name: Ensure `/boot/custom-splash.jpg` is absent.
ansible.builtin.file:
Expand All @@ -64,9 +64,9 @@
ansible.builtin.copy:
src: '{{ branding__custom_splash }}'
dest: '/root/custom-splash{{ branding__custom_splash_ext }}'
owner: root
group: root
mode: 0o644
owner: 'root'
group: 'root'
mode: '0o644'

- name: Ensure file exists in `.jpg` format.
ansible.builtin.shell: >
Expand Down
4 changes: 2 additions & 2 deletions roles/branding/tasks/clipit-nohistory.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
state: directory
owner: '{{ user }}'
group: '{{ user }}'
mode: 0o750
mode: '0o750'
recurse: false
become: true

Expand All @@ -25,7 +25,7 @@
dest: '{{ homedir[user] }}/.config/clipit/clipitrc'
owner: '{{ user }}'
group: '{{ user }}'
mode: 0o640
mode: '0o640'
become: true
when: not branding__clipitrc.stat.exists

Expand Down
4 changes: 2 additions & 2 deletions roles/branding/tasks/lxde-desktop-configure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
state: directory
owner: '{{ user }}'
group: '{{ user }}'
mode: 0o750
mode: '0o750'
become: true
become_user: '{{ user }}'
loop: '{{ branding__config_templates }}'
Expand All @@ -83,7 +83,7 @@
dest: "{{ branding__dot_config_dir + item | replace('.j2', '') }}"
owner: '{{ user }}'
group: '{{ user }}'
mode: 0o750
mode: '0o750'
become: true
become_user: '{{ user }}'
loop: '{{ branding__config_templates }}'
Expand Down
12 changes: 6 additions & 6 deletions roles/branding/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,19 +95,19 @@
ansible.builtin.file:
path: '{{ branding__lxde_wallpapers_directory }}'
state: directory
owner: root
group: root
mode: 0o755
owner: 'root'
group: 'root'
mode: '0o755'
become: true

- name: Ensure `custom-splash.jpg` is an optional desktop background.
ansible.builtin.copy:
src: '/root/custom-splash.jpg'
dest: '{{ branding__lxde_wallpapers_directory }}/custom-splash.jpg'
remote_src: true
owner: root
group: root
mode: 0o644
owner: 'root'
group: 'root'
mode: '0o644'
become: true

# https://martin.hoppenheit.info/blog/2016/where-to-put-application-icons-on-linux/
Expand Down
6 changes: 3 additions & 3 deletions roles/dropins/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@
ansible.builtin.copy:
src: dotlocal.sh
dest: /etc/profile.d/dotlocal.sh
owner: root
group: root
mode: 0o644
owner: 'root'
group: 'root'
mode: '0o644'
become: true

# vim: ft=ansible :
2 changes: 1 addition & 1 deletion roles/dropins/tasks/setup_dropin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
ansible.builtin.template:
dest: '{{ dropins__dropin_path }}'
src: 'dropin_header.j2'
mode: 0o640
mode: '0o640'
register: dropins__copy_result
when: not dropins__file_result.stat.exists

Expand Down
18 changes: 9 additions & 9 deletions roles/ip_in_issue/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,9 @@
ansible.builtin.template:
src: issue.j2
dest: /etc/issue
owner: root
group: root
mode: 0o644
owner: 'root'
group: 'root'
mode: '0o644'
register: ip_in_issue__etc_issue
changed_when:
- ip_in_issue__etc_issue.changed
Expand Down Expand Up @@ -134,9 +134,9 @@
ansible.builtin.file:
path: /etc/issue.d
state: directory
owner: root
group: root
mode: 0o755
owner: 'root'
group: 'root'
mode: '0o755'
become: true

# NetworkManager randomizes the MAC address on the `wlan0`
Expand All @@ -148,9 +148,9 @@
ansible.builtin.template:
src: '{{ item }}'
dest: '/etc/issue.d/{{ item.replace(".j2", "") | basename }}'
owner: root
group: root
mode: 0o644
owner: 'root'
group: 'root'
mode: '0o644'
with_items: '{{ ip_in_issue__issue_templates }}'
changed_when: false
become: true
Expand Down
4 changes: 2 additions & 2 deletions roles/kali_like/tasks/install_helper_scripts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
state: directory
owner: '{{ user }}'
group: '{{ user }}'
mode: 0o750
mode: '0o750'
become: true
when: not kali_like__dot_local_result.stat.exists

Expand All @@ -34,7 +34,7 @@
dest: "{{ kali_like__dot_local_bin + item | replace('.sh.j2', '') }}"
owner: '{{ user }}'
group: '{{ user }}'
mode: 0o755
mode: '0o755'
become: true
loop: '{{ kali_like__script_templates }}'

Expand Down
4 changes: 2 additions & 2 deletions roles/kali_like/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
state: directory
owner: 'root'
group: 'root'
mode: 0o755
mode: '0o755'
become: true

- name: Ensure kali-applications.menu exists.
Expand All @@ -75,7 +75,7 @@
dest: '/etc/xdg/menus/applications-merged/kali-applications.menu'
owner: 'root'
group: 'root'
mode: 0o644
mode: '0o644'
become: true

- name: Include hostname configuration tasks.
Expand Down
Loading

0 comments on commit b1e2c29

Please sign in to comment.