From 9af1f14a598d11b41b30b1505a77f051a18ca463 Mon Sep 17 00:00:00 2001 From: L3D Date: Tue, 31 Oct 2023 00:35:12 +0100 Subject: [PATCH] Add git diff (#7) --- defaults/main.yml | 1 + meta/main.yml | 1 - tasks/basic-selinux.yml | 2 +- tasks/ranger.yml | 4 ++-- tasks/versioncheck.yml | 19 ++++++++++--------- 5 files changed, 14 insertions(+), 13 deletions(-) diff --git a/defaults/main.yml b/defaults/main.yml index d6d5e65..84898d2 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -22,6 +22,7 @@ dotfiles__aliases: - {alias: "VISUAL", command: "/usr/bin/gedit", color: false} - {alias: "gitsubpull", command: "git submodule foreach '(git checkout \\$(git symbolic-ref --short refs/remotes/origin/HEAD | sed 's@^origin/@@'); git pull)'", color: false} - {alias: "pwgen", command: "/usr/bin/pwgen --num-passwords=3000 --numerals --capitalize --secure --no-vowels --ambiguous 95 1", color: false} + - {alias: "gdiff", command: "git diff --submodule=diff", color: false} # enable bash completion dotfiles__bash_completion_enabled: true diff --git a/meta/main.yml b/meta/main.yml index c6b960c..fc53000 100644 --- a/meta/main.yml +++ b/meta/main.yml @@ -5,7 +5,6 @@ galaxy_info: role_name: dotfiles license: "MIT" min_ansible_version: 2.11 - github_branch: main platforms: - name: Archlinux versions: all diff --git a/tasks/basic-selinux.yml b/tasks/basic-selinux.yml index 0728eb7..7c0d58d 100644 --- a/tasks/basic-selinux.yml +++ b/tasks/basic-selinux.yml @@ -1,5 +1,5 @@ --- -- name: install the latest libselinux-python package +- name: Install the latest libselinux-python package become: true ansible.builtin.dnf: name: libselinux-python diff --git a/tasks/ranger.yml b/tasks/ranger.yml index 4316c2f..cb4245c 100644 --- a/tasks/ranger.yml +++ b/tasks/ranger.yml @@ -1,5 +1,5 @@ --- -- name: create .config/ranger/ directory +- name: Create .config/ranger/ directory become: true ansible.builtin.file: path: "/home/{{ item }}/.config/ranger" @@ -14,7 +14,7 @@ - accounts != ['root'] - accounts != 'root' -- name: create .config/ranger/rc.conf file +- name: Create .config/ranger/rc.conf file become: true ansible.builtin.template: src: templates/ranger_rc.conf.j2 diff --git a/tasks/versioncheck.yml b/tasks/versioncheck.yml index 5128cc8..0da894b 100644 --- a/tasks/versioncheck.yml +++ b/tasks/versioncheck.yml @@ -8,37 +8,38 @@ path: '/etc/.ansible-version' state: directory mode: 0755 - when: submodules_versioncheck|bool + when: submodules_versioncheck | bool -- name: check playbook version +- name: Check playbook version become: true ansible.builtin.slurp: src: "/etc/.ansible-version/{{ playbook_version_path }}" register: playbook_version - when: submodules_versioncheck|bool + when: submodules_versioncheck | bool ignore_errors: true failed_when: false - name: Print remote role version ansible.builtin.debug: msg: "Remote role version: {{ playbook_version.content | default('Y3VycmVudGx5IG5vdCBkZXBsb3llZAo=') | b64decode | string }}" - when: submodules_versioncheck|bool + when: submodules_versioncheck | bool - name: Print locale role version ansible.builtin.debug: - msg: "Local role version: '{{ playbook_version_number|string }}'." - when: submodules_versioncheck|bool + msg: "Local role version: '{{ playbook_version_number | string }}'." + when: submodules_versioncheck | bool - name: Check if your version is outdated 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 + - playbook_version.content | default("Mgo=") | b64decode | int - 1 >= playbook_version_number | int and submodules_versioncheck | bool -- name: write new version to remote disk +- name: Write new version to remote disk become: true ansible.builtin.copy: content: "{{ playbook_version_number }}" dest: "/etc/.ansible-version/{{ playbook_version_path }}" mode: '0644' - when: submodules_versioncheck|bool + when: submodules_versioncheck | bool + tags: skip_ansible_lint_rule_template-instead-of-copy