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
github: [do1jlr]
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
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:

View file

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

View file

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

View file

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