1
0
Fork 0
mirror of https://github.com/roles-ansible/ansible_role_xrandr_help.git synced 2024-08-16 10:09:52 +02:00

update to new ansible naming scheme

This commit is contained in:
L3D 2021-03-16 20:33:27 +01:00
parent a7415b576d
commit 17e1afdacc
Signed by: l3d
GPG key ID: CD08445BFF4313D1
6 changed files with 27 additions and 40 deletions

2
.github/FUNDING.yml vendored
View file

@ -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

8
.yamllint Normal file
View file

@ -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

View file

@ -3,7 +3,7 @@ galaxy_info:
author: L3D author: L3D
description: Install xrandr and their graphical version (arandr) to control your monitors. description: Install xrandr and their graphical version (arandr) to control your monitors.
license: license (MIT) license: license (MIT)
min_ansible_version: 2.3 min_ansible_version: 2.8
role_name: xrandr_help role_name: xrandr_help
github_branch: master github_branch: master
platforms: platforms:

View file

@ -1,27 +1,27 @@
--- ---
- name: Include OS Specific vars - name: Include OS Specific vars
include_vars: "{{ ansible_os_family }}.yml" ansible.builtin.include_vars: "{{ ansible_os_family }}.yml"
- name: make versionscheck - name: make versionscheck
include_tasks: versioncheck.yml ansible.builtin.include_tasks: versioncheck.yml
when: submodules_versioncheck|bool when: submodules_versioncheck|bool
- name: Install xrandr - name: Install xrandr
become: true become: true
package: ansible.builtin.package:
name: "{{ xrandr_package }}" name: "{{ xrandr_package }}"
state: present state: present
- name: Install arandr gui - name: Install arandr gui
become: true become: true
package: ansible.builtin.package:
name: "{{ graphical_xrandr_packages }}" name: "{{ graphical_xrandr_packages }}"
state: present state: present
when: install_graphical_application|bool when: install_graphical_application|bool
- name: Install autorandr - name: Install autorandr
become: true become: true
package: ansible.builtin.package:
name: "{{ autorandr }}" name: "{{ autorandr }}"
state: present state: present
when: install_autorandr_application|bool when: install_autorandr_application|bool

View file

@ -1,67 +1,46 @@
--- ---
- 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
when: submodules_versioncheck|bool 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 - 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
- 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
- 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 - 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: 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 - 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'
when: submodules_versioncheck|bool when: submodules_versioncheck|bool

View file

@ -1,3 +1,3 @@
--- ---
playbook_version_number: 1024 # should be high!!! playbook_version_number: 1025 # should be int
playbook_version_path: 'role-xrandr_chaos-bodensee_github.com.version' playbook_version_path: 'role-xrandr_chaos-bodensee_github.com.version'