Skip to content
Snippets Groups Projects
Commit f1774b4a authored by Thomas Schneider's avatar Thomas Schneider
Browse files

*: Fix or document ansible-lint violations

parent 8cb693a9
Branches
No related tags found
1 merge request!26Update CI to reasonable versions and fix resulting issues
Pipeline #5143 passed
Showing
with 50 additions and 25 deletions
# This file contains ignores rule violations for ansible-lint
hostkey-provider/tasks/main.yml ignore-errors
shell/tasks/shell.yml schema[moves]
ssh-server/tasks/main.yml no-changed-when
--- ---
# file: common/apt/defaults/main.yml
apt_mirror: 'http://ftp.halifax.rwth-aachen.de/debian/' apt_mirror: 'http://ftp.halifax.rwth-aachen.de/debian/'
apt_mirror_security: 'http://security.debian.org/debian-security/' apt_mirror_security: 'http://security.debian.org/debian-security/'
......
--- ---
# file: roles/common/handlers/main.yml
- name: update apt cache - name: update apt cache
apt: update_cache=yes apt:
update_cache: true
--- ---
# file: roles/common/tasks/repositories.yml
# yamllint disable rule:line-length # yamllint disable rule:line-length
- name: enable debian repositories - name: enable debian repositories
......
--- ---
# file: roles/common/handlers/main.yml
- name: restart rsyslogd - name: restart rsyslogd
service: name=rsyslog state=restarted service:
name: rsyslog
state: restarted
- name: restart systemd-journald - name: restart systemd-journald
systemd: name=systemd-journald.service state=restarted systemd:
name: systemd-journald.service
state: restarted
- name: configure journal directory - name: configure journal directory
command: systemd-tmpfiles --create --prefix /var/log/journal command: systemd-tmpfiles --create --prefix /var/log/journal
...@@ -14,14 +17,16 @@ ...@@ -14,14 +17,16 @@
command: update-initramfs -u command: update-initramfs -u
- name: gather network facts once again - name: gather network facts once again
setup: gather_subset=network setup:
gather_subset: network
- name: gather minimal standard facts once again - name: gather minimal standard facts once again
setup: gather_subset=min setup:
gather_subset: min
- name: Remove pve directory from etckeeper repo - name: Remove pve directory from etckeeper repo
# 303 wants us to use the ansible git module, but it doesn’t # ansible-lint wants us to use the ansible git module, but it doesn’t
# provide that feature # provide that feature
shell: # noqa 303 shell: # noqa: command-instead-of-module
chdir: /etc chdir: /etc
cmd: git rm --cached -r -- pve && git commit -m "'Remove pve directory'" cmd: git rm --cached -r -- pve && git commit -m "'Remove pve directory'"
--- ---
# file: roles/common/task/logging.yml
- name: restrict dmesg access to only root - name: restrict dmesg access to only root
sysctl: sysctl:
...@@ -24,7 +23,9 @@ ...@@ -24,7 +23,9 @@
- journal - journal
- name: ensure systemd journal is persistent - name: ensure systemd journal is persistent
file: # Not setting permissions here is okay because the handler will correct it via
# tmpfiles
file: # noqa: risky-file-permissions
path: /var/log/journal path: /var/log/journal
state: directory state: directory
when: when:
......
...@@ -32,6 +32,9 @@ ...@@ -32,6 +32,9 @@
path: /etc/.gitignore path: /etc/.gitignore
line: /pve line: /pve
create: true create: true
owner: root
group: root
mode: "0600"
when: etckeeper and pve_present.stat.exists when: etckeeper and pve_present.stat.exists
notify: notify:
- Remove pve directory from etckeeper repo - Remove pve directory from etckeeper repo
......
...@@ -52,6 +52,9 @@ ...@@ -52,6 +52,9 @@
template: template:
src: hosts.j2 src: hosts.j2
dest: /etc/hosts dest: /etc/hosts
owner: root
group: root
mode: "0644"
when: not hosts_precious when: not hosts_precious
notify: notify:
- gather network facts once again - gather network facts once again
......
--- ---
- name: re-read local facts for new hostkeys - name: re-read local facts for new hostkeys
setup: filter=ansible_local setup:
filter: ansible_local
...@@ -6,6 +6,9 @@ ...@@ -6,6 +6,9 @@
section: collected section: collected
option: "{{ item.key }}" option: "{{ item.key }}"
value: "{{ item.value }}" value: "{{ item.value }}"
owner: root
group: root
mode: "0644"
with_items: with_items:
- {key: 'ipv4', value: "{{ ansible_all_ipv4_addresses|join(',') }}"} - {key: 'ipv4', value: "{{ ansible_all_ipv4_addresses|join(',') }}"}
- {key: 'ipv6', value: "{{ ansible_all_ipv6_addresses|join(',') }}"} - {key: 'ipv6', value: "{{ ansible_all_ipv6_addresses|join(',') }}"}
......
--- ---
# file: roles/common/handlers/main.yml
- name: restart ntpd - name: restart ntpd
service: name=ntp state=restarted service:
name: ntp
state: restarted
- name: restart timesyncd - name: restart timesyncd
service: name=systemd-timesyncd state=restarted service:
name: systemd-timesyncd
state: restarted
- name: update timezone - name: update timezone
command: dpkg-reconfigure --frontend noninteractive tzdata command: dpkg-reconfigure --frontend noninteractive tzdata
--- ---
# file: localization/tasks/ntpd.yml
- name: ensure ntpd is installed - name: ensure ntpd is installed
apt: apt:
...@@ -29,6 +28,9 @@ ...@@ -29,6 +28,9 @@
template: template:
src: ntp.conf.j2 src: ntp.conf.j2
dest: /etc/ntp.conf dest: /etc/ntp.conf
owner: root
group: root
mode: "0644"
notify: notify:
- restart ntpd - restart ntpd
tags: tags:
......
--- ---
# file: roles/common/tasks/ntp.yml
- name: ensure there is no ntpd interfering - name: ensure there is no ntpd interfering
apt: apt:
...@@ -13,6 +12,9 @@ ...@@ -13,6 +12,9 @@
template: template:
src: timesyncd.conf.j2 src: timesyncd.conf.j2
dest: /etc/systemd/timesyncd.conf dest: /etc/systemd/timesyncd.conf
owner: root
group: root
mode: "0644"
notify: notify:
- restart timesyncd - restart timesyncd
tags: tags:
......
--- ---
# file: roles/common/handlers/main.yml
- name: rerun depmod - name: rerun depmod
command: depmod -ae command: depmod -ae
......
--- ---
# file: roles/common/tasks/shell.yml
- name: ensure installation of basic shell commands - name: ensure installation of basic shell commands
apt: apt:
...@@ -69,7 +68,9 @@ ...@@ -69,7 +68,9 @@
- shell - shell
- name: ensure we have an up-to-date version of grml-zsh-config - name: ensure we have an up-to-date version of grml-zsh-config
get_url: # Skip risky-file-permissions check because this runs locally, and we don’t
# even know who the local user running Ansible is.
get_url: # noqa: risky-file-permissions
url: https://www.archlinux.org/packages/extra/any/grml-zsh-config/download/ url: https://www.archlinux.org/packages/extra/any/grml-zsh-config/download/
dest: "{{ role_path }}/files/" dest: "{{ role_path }}/files/"
delegate_to: localhost delegate_to: localhost
...@@ -99,6 +100,9 @@ ...@@ -99,6 +100,9 @@
copy: copy:
src: /etc/skel/.zshrc src: /etc/skel/.zshrc
dest: /root/.zshrc dest: /root/.zshrc
owner: root
group: root
mode: "0644"
remote_src: true remote_src: true
tags: tags:
- config - config
......
--- ---
# file: roles/common/tasks/sudo.yml
- name: ensure sudo is installed - name: ensure sudo is installed
apt: apt:
......
--- ---
# file: common/ssh-server/defaults/main.yml
ssh_authorized_keys: "{{ inventory_dir }}/files/keys" ssh_authorized_keys: "{{ inventory_dir }}/files/keys"
ssh_mkhomedir: true ssh_mkhomedir: true
......
--- ---
# file: roles/common/tasks/sshd.yml
- name: ensure sshd is installed - name: ensure sshd is installed
apt: apt:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment