mirror of
https://github.com/roles-ansible/ansible_role_dotfiles.git
synced 2024-08-16 16:09:49 +02:00
implement version control
This commit is contained in:
parent
341d3886d3
commit
1c25806494
2 changed files with 50 additions and 4 deletions
|
@ -1,4 +1,37 @@
|
||||||
---
|
---
|
||||||
|
- name: Create directory for versionscheck
|
||||||
|
become: true
|
||||||
|
file:
|
||||||
|
path: '/etc/ansible-version'
|
||||||
|
state: directory
|
||||||
|
mode: 0755
|
||||||
|
when: submodules_versioncheck
|
||||||
|
|
||||||
|
- name: check playbook version
|
||||||
|
become: true
|
||||||
|
slurp:
|
||||||
|
src: "{{ playbook_version_path }}"
|
||||||
|
register: playbook_version
|
||||||
|
when: submodules_versioncheck
|
||||||
|
ignore_errors: yes
|
||||||
|
|
||||||
|
- name: Print version
|
||||||
|
debug:
|
||||||
|
msg: "Remote playbook version: '{{ playbook_version.content | default('Y3VycmVudGx5IG5vdCBkZXBsb3llZAo=') | b64decode | string }}'. Local playbook version: '{{ playbook_version_number|string }}'."
|
||||||
|
when: submodules_versioncheck
|
||||||
|
|
||||||
|
- name: Check if your version is outdated
|
||||||
|
fail:
|
||||||
|
msg: "Your current ansible module has the version '{{ playbook_version_number }}' and is outdated. Please update it at least to version '{{ playbook_version.content | default('Y3VycmVudGx5IG5vdCBkZXBsb3llZAo=') | b64decode }}'!"
|
||||||
|
when:
|
||||||
|
- playbook_version.content|default("Mgo=")|b64decode|int - 1 >= playbook_version_number|int and submodules_versioncheck
|
||||||
|
|
||||||
|
- name: write new version to remote disk
|
||||||
|
become: true
|
||||||
|
copy:
|
||||||
|
content: "{{ playbook_version_number }}"
|
||||||
|
dest: "{{ playbook_version_path }}"
|
||||||
|
when: submodules_versioncheck
|
||||||
|
|
||||||
- name: install the latest libselinux-python package
|
- name: install the latest libselinux-python package
|
||||||
become: yes
|
become: yes
|
||||||
|
@ -56,8 +89,8 @@
|
||||||
owner: '{{ item }}'
|
owner: '{{ item }}'
|
||||||
group: '{{ item }}'
|
group: '{{ item }}'
|
||||||
mode: 'u=rw,g=r,o='
|
mode: 'u=rw,g=r,o='
|
||||||
with_items: '{{ user }}'
|
with_items: '{{ accounts }}'
|
||||||
when: user is defined
|
when: accounts is defined
|
||||||
|
|
||||||
- name: Copy vimrc configuration to root
|
- name: Copy vimrc configuration to root
|
||||||
become: yes
|
become: yes
|
||||||
|
@ -76,8 +109,8 @@
|
||||||
owner: '{{ item }}'
|
owner: '{{ item }}'
|
||||||
group: '{{ item }}'
|
group: '{{ item }}'
|
||||||
mode: 'u=rw,g=r,o='
|
mode: 'u=rw,g=r,o='
|
||||||
with_items: "{{ user }}"
|
with_items: "{{ accounts }}"
|
||||||
when: user is defined
|
when: accounts is defined
|
||||||
|
|
||||||
- name: Copy vimrc configuration to admin users
|
- name: Copy vimrc configuration to admin users
|
||||||
become: yes
|
become: yes
|
||||||
|
|
13
vars/main.yml
Normal file
13
vars/main.yml
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
# some bash variables
|
||||||
|
bash:
|
||||||
|
bashrc: ''
|
||||||
|
keychain: 'eval $(keychain --eval --quiet id_ed25519)'
|
||||||
|
nextcloud: false
|
||||||
|
nm: false
|
||||||
|
pwgen: true
|
||||||
|
shell: "/bin/bash"
|
||||||
|
keyboard: '$(if [[ $(id -u) -ne 0 ]];then echo "\[\033[01;33m\]"; else echo "\[\033[01;31m\]"; fi) $(if [[ $? == 0 ]]; then printf "\xE2\x9D\xA4"; fi) \[\033[01;32m\]\u\[\033[01;36m\]@\[\033[01;32m\]\H\[\033[01;34m\] <\A> \[\033[01;35m\] \j \[\033[01;36m\] \w \[\033[01;33m\]\n\[\033[01;33m\] $(git branch 2>/dev/null | sed -n "s/* \(.*\)/\1 /p")$\[\033[01;00m\] '
|
||||||
|
|
||||||
|
|
||||||
|
playbook_version_number: 100 # integer without dots
|
||||||
|
playbook_version_path: '/etc/ansible-version/role_dotfiles_chaos-bodensee_github.version'
|
Loading…
Reference in a new issue