diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 0000000..009cbb5 --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1,5 @@ +# Feel free to add yourself after && during participating at this repo! + +github: [do1jlr] +liberapay: L3D +custom: ['https://paypal.me/c3woc'] diff --git a/LICENSE b/LICENSE index e611413..10e0d6d 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2020 Chaos Bodensee +Copyright (c) 2020 L3D Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index e43aed0..bd5b4c6 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,8 @@ -# role-ranger -Ansible role to install the ranger file manager on linux + role-ranger +============== + +Ansible role to install the ranger file manager on linux. ranger is a console file manager with VI key bindings. More info about ranger is available at [github.com/ranger/ranger](https://github.com/ranger/ranger.git). + +``` +[WORK-IN-PROGRESS] +``` diff --git a/defaults/main.yml b/defaults/main.yml new file mode 100644 index 0000000..1c4eebc --- /dev/null +++ b/defaults/main.yml @@ -0,0 +1,2 @@ +--- +submodules_versioncheck: true diff --git a/tasks/main.yml b/tasks/main.yml new file mode 100644 index 0000000..183d982 --- /dev/null +++ b/tasks/main.yml @@ -0,0 +1,4 @@ +--- +- include_tasks: versioncheck.yml + when: submodules_versioncheck|bool + diff --git a/tasks/versioncheck.yml b/tasks/versioncheck.yml new file mode 100644 index 0000000..9895582 --- /dev/null +++ b/tasks/versioncheck.yml @@ -0,0 +1,44 @@ +--- +- name: Create directory for versionscheck + become: true + file: + path: '/etc/.ansible-version' + state: directory + mode: 0755 + when: submodules_versioncheck|bool + +- name: check playbook version + become: true + slurp: + src: "/etc/.ansible-version/{{ playbook_version_path }}" + register: playbook_version + when: submodules_versioncheck|bool + ignore_errors: yes + +- name: Print remote role version + debug: + msg: "Remote role version: {{ playbook_version.content | default('Y3VycmVudGx5IG5vdCBkZXBsb3llZAo=') | b64decode | string }}" + when: submodules_versioncheck|bool + +- name: Print locale role version + debug: + msg: "Local role version: '{{ playbook_version_number|string }}'." + when: submodules_versioncheck|bool + +- name: Check if your version is outdated + 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: + paths: '/etc/ansible-version/' + register: filesFound + +- name: write new version to remote disk + become: true + copy: + content: "{{ playbook_version_number }}" + dest: "/etc/.ansible-version/{{ playbook_version_path }}" + when: submodules_versioncheck|bool diff --git a/vars/main.yml b/vars/main.yml new file mode 100644 index 0000000..d6795a0 --- /dev/null +++ b/vars/main.yml @@ -0,0 +1,3 @@ +--- +playbook_version_number: 1024 # should be over ninethousand +playbook_version_path: 'role-ranger_chaos-bodensee_github.com.version'