mirror of
https://github.com/roles-ansible/ansible_role_i3wm.git
synced 2024-08-16 10:09:53 +02:00
fix yaml linting
This commit is contained in:
parent
b699dfb732
commit
4dcb2d1990
9 changed files with 21 additions and 65 deletions
2
.github/FUNDING.yml
vendored
2
.github/FUNDING.yml
vendored
|
@ -1,5 +1,5 @@
|
||||||
|
---
|
||||||
# These are supported funding model platforms
|
# These are supported funding model platforms
|
||||||
|
|
||||||
github: [do1jlr]
|
github: [do1jlr]
|
||||||
liberapay: L3D
|
liberapay: L3D
|
||||||
custom: https://paypal.me/c3woc
|
|
||||||
|
|
20
.github/workflows/ansible-linting-chek.yml
vendored
20
.github/workflows/ansible-linting-chek.yml
vendored
|
@ -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]
|
|
25
.travis.yml
25
.travis.yml
|
@ -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/
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
---
|
||||||
extends: default
|
extends: default
|
||||||
|
|
||||||
rules:
|
rules:
|
||||||
|
|
|
@ -3,5 +3,5 @@
|
||||||
pacman:
|
pacman:
|
||||||
name: "{{ i3_packages }}"
|
name: "{{ i3_packages }}"
|
||||||
state: present
|
state: present
|
||||||
update_cache: yes
|
update_cache: true
|
||||||
become: true
|
become: true
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
---
|
---
|
||||||
- name: Create directory for versionscheck
|
- name: Create directory for versionscheck
|
||||||
become: true
|
become: true
|
||||||
file:
|
ansible.builtin.file:
|
||||||
path: '/etc/.ansible-version'
|
path: '/etc/.ansible-version'
|
||||||
state: directory
|
state: directory
|
||||||
mode: 0755
|
mode: 0755
|
||||||
|
@ -9,38 +9,38 @@
|
||||||
|
|
||||||
- name: check playbook version
|
- name: check playbook version
|
||||||
become: true
|
become: true
|
||||||
slurp:
|
ansible.builtin.slurp:
|
||||||
src: "/etc/.ansible-version/{{ playbook_version_path }}"
|
src: "/etc/.ansible-version/{{ playbook_version_path }}"
|
||||||
register: playbook_version
|
register: playbook_version
|
||||||
when: submodules_versioncheck|bool
|
when: submodules_versioncheck|bool
|
||||||
ignore_errors: yes
|
ignore_errors: true
|
||||||
failed_when: false
|
failed_when: false
|
||||||
|
|
||||||
- name: Print remote role version
|
- name: Print remote role version
|
||||||
debug:
|
ansible.builtin.debug:
|
||||||
msg: "Remote role version: {{ playbook_version.content | default('Y3VycmVudGx5IG5vdCBkZXBsb3llZAo=') | b64decode | string }}"
|
msg: "Remote role version: {{ playbook_version.content | default('Y3VycmVudGx5IG5vdCBkZXBsb3llZAo=') | b64decode | string }}"
|
||||||
when: submodules_versioncheck|bool
|
when: submodules_versioncheck|bool
|
||||||
|
|
||||||
- name: Print locale role version
|
- name: Print locale role version
|
||||||
debug:
|
ansible.builtin.debug:
|
||||||
msg: "Local role version: '{{ playbook_version_number|string }}'."
|
msg: "Local role version: '{{ playbook_version_number|string }}'."
|
||||||
when: submodules_versioncheck|bool
|
when: submodules_versioncheck|bool
|
||||||
|
|
||||||
- name: Check if your version is outdated
|
- 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!"
|
msg: "Your ansible module has the version '{{ playbook_version_number }}' and is outdated. You need to update it!"
|
||||||
when:
|
when:
|
||||||
- playbook_version.content|default("Mgo=")|b64decode|int - 1 >= playbook_version_number|int and submodules_versioncheck|bool
|
- playbook_version.content|default("Mgo=")|b64decode|int - 1 >= playbook_version_number|int and submodules_versioncheck|bool
|
||||||
|
|
||||||
- name: check if '/etc/ansible-version/' is empty
|
- name: check if '/etc/ansible-version/' is empty
|
||||||
find:
|
ansible.builtin.find:
|
||||||
paths: '/etc/ansible-version/'
|
paths: '/etc/ansible-version/'
|
||||||
register: filesFound
|
register: filesFound
|
||||||
|
|
||||||
- name: write new version to remote disk
|
- name: write new version to remote disk
|
||||||
become: true
|
become: true
|
||||||
copy:
|
ansible.builtin.copy:
|
||||||
content: "{{ playbook_version_number }}"
|
content: "{{ playbook_version_number }}"
|
||||||
dest: "/etc/.ansible-version/{{ playbook_version_path }}"
|
dest: "/etc/.ansible-version/{{ playbook_version_path }}"
|
||||||
mode: 0644
|
mode: '0644'
|
||||||
when: submodules_versioncheck|bool
|
when: submodules_versioncheck|bool
|
||||||
|
|
|
@ -33,5 +33,5 @@ __i3_workspaces:
|
||||||
|
|
||||||
user: "{{ i3wm_user }}"
|
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'
|
playbook_version_path: 'role-i3wm_chaos-bodensee_github.com.version'
|
||||||
|
|
Loading…
Reference in a new issue