From 4dcb2d199008ec7404b50f5aaeae25544c37d0dd Mon Sep 17 00:00:00 2001 From: L3D Date: Fri, 26 Feb 2021 17:31:17 +0100 Subject: [PATCH] fix yaml linting --- .github/FUNDING.yml | 2 +- .github/workflows/ansible-linting-chek.yml | 20 ----------------- .travis.yml | 25 ---------------------- .yamllint | 3 ++- defaults/main.yml | 2 +- tasks/setup-Archlinux.yml | 2 +- tasks/variables.yml | 12 +++++------ tasks/versioncheck.yml | 18 ++++++++-------- vars/main.yml | 2 +- 9 files changed, 21 insertions(+), 65 deletions(-) delete mode 100644 .github/workflows/ansible-linting-chek.yml delete mode 100644 .travis.yml diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml index 1a95489..fab5174 100644 --- a/.github/FUNDING.yml +++ b/.github/FUNDING.yml @@ -1,5 +1,5 @@ +--- # These are supported funding model platforms github: [do1jlr] liberapay: L3D -custom: https://paypal.me/c3woc diff --git a/.github/workflows/ansible-linting-chek.yml b/.github/workflows/ansible-linting-chek.yml deleted file mode 100644 index 712c76f..0000000 --- a/.github/workflows/ansible-linting-chek.yml +++ /dev/null @@ -1,20 +0,0 @@ -name: Ansible Lint check - -on: [push, pull_request] - -jobs: - build: - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - - name: Lint Ansible Playbook - uses: ansible/ansible-lint-action@master - with: - targets: "." - # [required] - # Paths to ansible files (i.e., playbooks, tasks, handlers etc..) - args: "" - # [optional] diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index b732d0e..0000000 --- a/.travis.yml +++ /dev/null @@ -1,25 +0,0 @@ ---- -sudo: required -env: - - distribution: fedora - version: 29 - - distribution: fedora - version: 28 - - distribution: ubuntu - version: bionic - - distribution: debian - version: stretch -services: - - docker -before_install: - - 'sudo docker pull ${distribution}:${version}' - - 'sudo docker build --no-cache --rm --file=travis/Dockerfile.${distribution}-${version} --tag=${distribution}-${version}:ansible travis' -script: - - container_id=$(mktemp) - - 'sudo docker run --detach --privileged -v /sys/fs/cgroup:/sys/fs/cgroup:ro --volume="${PWD}":/etc/ansible/roles/travis_test:ro ${distribution}-${version}:ansible > "${container_id}"' - - 'sudo docker exec "$(cat ${container_id})" env ANSIBLE_FORCE_COLOR=1 ansible-playbook -v /etc/ansible/roles/travis_test/travis/test.yml --syntax-check' - - 'sudo docker exec "$(cat ${container_id})" env ANSIBLE_FORCE_COLOR=1 ansible-playbook -v /etc/ansible/roles/travis_test/travis/test.yml' - - 'sudo docker exec "$(cat ${container_id})" env ANSIBLE_FORCE_COLOR=1 ansible-playbook -v /etc/ansible/roles/travis_test/travis/test.yml' - - 'sudo docker rm -f "$(cat ${container_id})"' -notifications: - webhooks: https://galaxy.ansible.com/api/v1/notifications/ diff --git a/.yamllint b/.yamllint index 1a3136b..7fa9ec4 100644 --- a/.yamllint +++ b/.yamllint @@ -1,3 +1,4 @@ +--- extends: default rules: @@ -8,4 +9,4 @@ rules: max-spaces-inside: 1 level: error line-length: disable - comments-indentation: disable \ No newline at end of file + comments-indentation: disable diff --git a/defaults/main.yml b/defaults/main.yml index 038ce64..1d41680 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -50,7 +50,7 @@ i3wm_copy_wallpapers: true disable_screensaver: true enable_lock_after_time: false -lock_after_time: '200' # minutes to wait until your screen is locked +lock_after_time: '200' # minutes to wait until your screen is locked # version check for this role? submodules_versioncheck: true diff --git a/tasks/setup-Archlinux.yml b/tasks/setup-Archlinux.yml index 6f1b99b..558f8a5 100644 --- a/tasks/setup-Archlinux.yml +++ b/tasks/setup-Archlinux.yml @@ -3,5 +3,5 @@ pacman: name: "{{ i3_packages }}" state: present - update_cache: yes + update_cache: true become: true diff --git a/tasks/variables.yml b/tasks/variables.yml index 899c48e..908231f 100644 --- a/tasks/variables.yml +++ b/tasks/variables.yml @@ -29,19 +29,19 @@ set_fact: i3_keybindings: "{{ __i3_keybindings | list }}" when: - - i3_keybindings is not defined - - __i3_keybindings is defined + - i3_keybindings is not defined + - __i3_keybindings is defined - name: define extra i3 keybindings set_fact: i3_keybindings: "{{ i3_keybindings_extra | list + i3_keybindings | list }}" when: - - i3_keybindings_extra is defined - - i3_keybindings is defined + - i3_keybindings_extra is defined + - i3_keybindings is defined - name: define extra i3 keybindings set_fact: i3_keybindings: "{{ i3_keybindings_extra | list }}" when: - - i3_keybindings_extra is defined - - i3_keybindings is not defined + - i3_keybindings_extra is defined + - i3_keybindings is not defined diff --git a/tasks/versioncheck.yml b/tasks/versioncheck.yml index 7977e52..dca3e47 100644 --- a/tasks/versioncheck.yml +++ b/tasks/versioncheck.yml @@ -1,7 +1,7 @@ --- - name: Create directory for versionscheck become: true - file: + ansible.builtin.file: path: '/etc/.ansible-version' state: directory mode: 0755 @@ -9,38 +9,38 @@ - name: check playbook version become: true - slurp: + ansible.builtin.slurp: src: "/etc/.ansible-version/{{ playbook_version_path }}" register: playbook_version when: submodules_versioncheck|bool - ignore_errors: yes + ignore_errors: true failed_when: false - name: Print remote role version - debug: + ansible.builtin.debug: msg: "Remote role version: {{ playbook_version.content | default('Y3VycmVudGx5IG5vdCBkZXBsb3llZAo=') | b64decode | string }}" when: submodules_versioncheck|bool - name: Print locale role version - debug: + ansible.builtin.debug: msg: "Local role version: '{{ playbook_version_number|string }}'." when: submodules_versioncheck|bool - name: Check if your version is outdated - fail: + ansible.builtin.fail: msg: "Your ansible module has the version '{{ playbook_version_number }}' and is outdated. You need to update it!" when: - playbook_version.content|default("Mgo=")|b64decode|int - 1 >= playbook_version_number|int and submodules_versioncheck|bool - name: check if '/etc/ansible-version/' is empty - find: + ansible.builtin.find: paths: '/etc/ansible-version/' register: filesFound - name: write new version to remote disk become: true - copy: + ansible.builtin.copy: content: "{{ playbook_version_number }}" dest: "/etc/.ansible-version/{{ playbook_version_path }}" - mode: 0644 + mode: '0644' when: submodules_versioncheck|bool diff --git a/vars/main.yml b/vars/main.yml index 8974f3e..071278e 100644 --- a/vars/main.yml +++ b/vars/main.yml @@ -33,5 +33,5 @@ __i3_workspaces: user: "{{ i3wm_user }}" -playbook_version_number: 9015 # should be over ninethousand +playbook_version_number: 9015 # should be int playbook_version_path: 'role-i3wm_chaos-bodensee_github.com.version'