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

Add git diff (#7)

This commit is contained in:
L3D 2023-10-31 00:35:12 +01:00 committed by GitHub
parent 5cd1afc650
commit 9af1f14a59
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 14 additions and 13 deletions

View file

@ -22,6 +22,7 @@ dotfiles__aliases:
- {alias: "VISUAL", command: "/usr/bin/gedit", color: false} - {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: "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: "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 # enable bash completion
dotfiles__bash_completion_enabled: true dotfiles__bash_completion_enabled: true

View file

@ -5,7 +5,6 @@ galaxy_info:
role_name: dotfiles role_name: dotfiles
license: "MIT" license: "MIT"
min_ansible_version: 2.11 min_ansible_version: 2.11
github_branch: main
platforms: platforms:
- name: Archlinux - name: Archlinux
versions: all versions: all

View file

@ -1,5 +1,5 @@
--- ---
- name: install the latest libselinux-python package - name: Install the latest libselinux-python package
become: true become: true
ansible.builtin.dnf: ansible.builtin.dnf:
name: libselinux-python name: libselinux-python

View file

@ -1,5 +1,5 @@
--- ---
- name: create .config/ranger/ directory - name: Create .config/ranger/ directory
become: true become: true
ansible.builtin.file: ansible.builtin.file:
path: "/home/{{ item }}/.config/ranger" path: "/home/{{ item }}/.config/ranger"
@ -14,7 +14,7 @@
- accounts != ['root'] - accounts != ['root']
- accounts != 'root' - accounts != 'root'
- name: create .config/ranger/rc.conf file - name: Create .config/ranger/rc.conf file
become: true become: true
ansible.builtin.template: ansible.builtin.template:
src: templates/ranger_rc.conf.j2 src: templates/ranger_rc.conf.j2

View file

@ -8,37 +8,38 @@
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 playbook version - name: Check playbook version
become: true become: true
ansible.builtin.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: true ignore_errors: true
failed_when: false failed_when: false
- name: Print remote role version - name: Print remote role version
ansible.builtin.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
ansible.builtin.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
ansible.builtin.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
- name: write new version to remote disk - name: Write new version to remote disk
become: true become: true
ansible.builtin.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' mode: '0644'
when: submodules_versioncheck|bool when: submodules_versioncheck | bool
tags: skip_ansible_lint_rule_template-instead-of-copy