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/.yamllint b/.yamllint new file mode 100644 index 0000000..c8bbc93 --- /dev/null +++ b/.yamllint @@ -0,0 +1,8 @@ +--- +extends: default + +rules: + # 160 chars should be enough, but don't fail if a line is longer + line-length: + max: 160 + level: warning diff --git a/meta/main.yml b/meta/main.yml index 8d3d0e0..5f36f5c 100644 --- a/meta/main.yml +++ b/meta/main.yml @@ -3,7 +3,7 @@ galaxy_info: author: L3D description: Install xrandr and their graphical version (arandr) to control your monitors. license: license (MIT) - min_ansible_version: 2.3 + min_ansible_version: 2.8 role_name: xrandr_help github_branch: master platforms: diff --git a/tasks/main.yml b/tasks/main.yml index 5127a67..9202be1 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -1,27 +1,27 @@ --- - name: Include OS Specific vars - include_vars: "{{ ansible_os_family }}.yml" + ansible.builtin.include_vars: "{{ ansible_os_family }}.yml" - name: make versionscheck - include_tasks: versioncheck.yml + ansible.builtin.include_tasks: versioncheck.yml when: submodules_versioncheck|bool - name: Install xrandr become: true - package: + ansible.builtin.package: name: "{{ xrandr_package }}" state: present - name: Install arandr gui become: true - package: + ansible.builtin.package: name: "{{ graphical_xrandr_packages }}" state: present when: install_graphical_application|bool - name: Install autorandr become: true - package: + ansible.builtin.package: name: "{{ autorandr }}" state: present when: install_autorandr_application|bool diff --git a/tasks/versioncheck.yml b/tasks/versioncheck.yml index 9cfdbba..dca3e47 100644 --- a/tasks/versioncheck.yml +++ b/tasks/versioncheck.yml @@ -1,67 +1,46 @@ --- - name: Create directory for versionscheck become: true - file: + ansible.builtin.file: path: '/etc/.ansible-version' state: directory mode: 0755 when: submodules_versioncheck|bool -- name: check legacy playbook version - become: true - slurp: - src: "/etc/ansible-version/{{ playbook_version_path }}" - register: legacy_playbook_version - when: submodules_versioncheck|bool - ignore_errors: yes - changed_when: False - - 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 - - legacy_playbook_version.content|default("Mgo=")|b64decode|int - 1 >= playbook_version_number|int and submodules_versioncheck|bool - -- name: delete legacy version if needed - become: true - file: - state: absent - path: "/etc/ansible-version/{{ playbook_version_path }}" - name: check if '/etc/ansible-version/' is empty - find: + ansible.builtin.find: paths: '/etc/ansible-version/' register: filesFound -- name: delete legacy version folder if needed - become: true - file: - state: absent - path: "/etc/ansible-version" - when: filesFound.matched < 0 - - 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' when: submodules_versioncheck|bool diff --git a/vars/main.yml b/vars/main.yml index f5f6ff5..0690c9f 100644 --- a/vars/main.yml +++ b/vars/main.yml @@ -1,3 +1,3 @@ --- -playbook_version_number: 1024 # should be high!!! -playbook_version_path: 'role-xrandr_chaos-bodensee_github.com.version' +playbook_version_number: 1025 # should be int +playbook_version_path: 'role-xrandr_chaos-bodensee_github.com.version'