From 97f33f3bc722a119d8350bd355d20544ea1ddb97 Mon Sep 17 00:00:00 2001 From: David Kilias Date: Mon, 28 Dec 2020 22:53:53 +0100 Subject: [PATCH] yamllint config and fixes --- .yamllint | 10 ++++++++++ main.yml | 8 ++++---- pottwal.yml | 12 ++++++------ requirements.yml | 1 + roles/docker_setup/defaults/main.yml | 1 + roles/docker_setup/tasks/main.yml | 22 +++++++++++----------- roles/users/tasks/main.yml | 9 ++++----- tau.yml | 5 +++-- 8 files changed, 40 insertions(+), 28 deletions(-) create mode 100644 .yamllint diff --git a/.yamllint b/.yamllint new file mode 100644 index 0000000..da54cad --- /dev/null +++ b/.yamllint @@ -0,0 +1,10 @@ +--- +extends: default + +rules: + truthy: + allowed-values: + - 'true' + - 'false' + - 'yes' + - 'no' diff --git a/main.yml b/main.yml index d78ecf6..00d43b0 100644 --- a/main.yml +++ b/main.yml @@ -6,7 +6,7 @@ ansible_python_interpreter: /usr/bin/python3 roles: - - role: ansible.timezone + - role: ansible.timezone tasks: - name: Update and clean package cache @@ -25,10 +25,10 @@ name: ansible-role-unattended-upgrades vars: unattended_origins_patterns: - - 'origin=Debian,archive=buster-security' - - 'o=Debian,a=buster-updates' + - "origin=Debian,archive=buster-security" + - "o=Debian,a=buster-updates" unattended_package_blacklist: [cowsay] - unattended_mail: 'root' + unattended_mail: "root" - name: Setup users include_role: diff --git a/pottwal.yml b/pottwal.yml index 40863fc..8808a9f 100644 --- a/pottwal.yml +++ b/pottwal.yml @@ -1,3 +1,4 @@ +--- - hosts: pottwal.n39.eu become: true @@ -16,10 +17,10 @@ uritools_host_port: 8080 roles: - - role: docker_setup - vars: - docker_data_root: "/srv/docker" - - role: apache + - role: docker_setup + vars: + docker_data_root: "/srv/docker" + - role: apache tasks: - name: Ensure apt-cacher container is running @@ -101,8 +102,7 @@ - "{{ openhab_data }}/userdata:/openhab/userdata:rw" keep_volumes: yes restart_policy: unless-stopped - env: - EXTRA_JAVA_OPTS="-Duser.timezone=Europe/Berlin" + env: EXTRA_JAVA_OPTS="-Duser.timezone=Europe/Berlin" - name: Setup proxy site openhab.n39.eu include_role: diff --git a/requirements.yml b/requirements.yml index 36978db..0e5a058 100644 --- a/requirements.yml +++ b/requirements.yml @@ -1,3 +1,4 @@ +--- - src: git+https://github.com/jnv/ansible-role-unattended-upgrades.git version: v1.9.0 - src: git+https://github.com/adriagalin/ansible.timezone.git diff --git a/roles/docker_setup/defaults/main.yml b/roles/docker_setup/defaults/main.yml index 40dc492..f1d15e3 100644 --- a/roles/docker_setup/defaults/main.yml +++ b/roles/docker_setup/defaults/main.yml @@ -1,3 +1,4 @@ +--- docker_compose_version: "1.25.4" docker_compose_path: /usr/local/bin/docker-compose docker_data_root: "/var/lib/docker" diff --git a/roles/docker_setup/tasks/main.yml b/roles/docker_setup/tasks/main.yml index fe3edec..2d3a475 100644 --- a/roles/docker_setup/tasks/main.yml +++ b/roles/docker_setup/tasks/main.yml @@ -18,10 +18,10 @@ state: present vars: packages: - - apt-transport-https - - ca-certificates - - gnupg2 - - software-properties-common + - apt-transport-https + - ca-certificates + - gnupg2 + - software-properties-common - name: add Docker apt-key apt_key: @@ -30,10 +30,10 @@ - name: add Docker's APT repository apt_repository: - repo: deb https://download.docker.com/linux/debian buster stable - state: present - update_cache: true - filename: 'docker' + repo: deb https://download.docker.com/linux/debian buster stable + state: present + update_cache: true + filename: "docker" - name: install Docker package: @@ -41,8 +41,8 @@ state: present vars: packages: - - docker-ce - - python3-docker + - docker-ce + - python3-docker - name: Set docker configuration template: @@ -73,7 +73,7 @@ - name: Place admin users in docker group user: name: "{{ item.logname }}" - groups: docker + groups: [docker] append: yes when: item.docker with_items: "{{ users }}" diff --git a/roles/users/tasks/main.yml b/roles/users/tasks/main.yml index ad93bc1..15fa0fc 100644 --- a/roles/users/tasks/main.yml +++ b/roles/users/tasks/main.yml @@ -1,9 +1,8 @@ --- - - name: Ensure sudo is installed package: name: - - sudo + - sudo state: present - name: Configure group sudo for sudoers without password @@ -11,7 +10,7 @@ path: /etc/sudoers state: present regexp: '^%sudo\s' - line: '%sudo ALL=(ALL) NOPASSWD: ALL' + line: "%sudo ALL=(ALL) NOPASSWD: ALL" validate: /usr/sbin/visudo -cf %s - name: Add users | create users' shell and home dir @@ -30,12 +29,12 @@ with_subelements: - "{{ users }}" - ssh_pub - - skip_missing: True + - skip_missing: true - name: Place user in sudo group user: name: "{{ item.logname }}" - groups: sudo + groups: [sudo] append: yes when: item.sudo with_items: "{{ users }}" diff --git a/tau.yml b/tau.yml index a461316..374a65b 100644 --- a/tau.yml +++ b/tau.yml @@ -1,3 +1,4 @@ +--- - hosts: tau.netz39.de become: true @@ -5,8 +6,8 @@ ansible_python_interpreter: /usr/bin/python3 roles: - - role: docker_setup - - role: apache + - role: docker_setup + - role: apache tasks: - name: Setup docker network