mirror of
https://github.com/roles-ansible/ansible_role_dotfiles.git
synced 2024-08-16 16:09:49 +02:00
Update ansible version controll.
This commit is contained in:
parent
e794c0e7e5
commit
df81bd4f8f
3 changed files with 18 additions and 11 deletions
2
.ansible-lint
Normal file
2
.ansible-lint
Normal file
|
@ -0,0 +1,2 @@
|
|||
skip_list:
|
||||
- '403'
|
|
@ -11,19 +11,24 @@
|
|||
become: true
|
||||
slurp:
|
||||
src: "{{ playbook_version_path }}"
|
||||
register: playbook_version
|
||||
register: playbook_version
|
||||
when: submodules_versioncheck|bool
|
||||
ignore_errors: yes
|
||||
|
||||
- name: Print version
|
||||
- name: Print local version
|
||||
debug:
|
||||
msg: "Remote playbook version: '{{ playbook_version.content | default('Y3VycmVudGx5IG5vdCBkZXBsb3llZAo=') | b64decode | string }}'. Local playbook version: '{{ playbook_version_number|string }}'."
|
||||
msg: "Local role version: '{{ playbook_version_number|string }}'."
|
||||
when: submodules_versioncheck|bool
|
||||
|
||||
- name: Print remote version
|
||||
debug:
|
||||
msg: "Remote role version: '{{ playbook_version.content | default('Y3VycmVudGx5IG5vdCBkZXBsb3llZAo=') | b64decode | string }}'."
|
||||
when: submodules_versioncheck|bool
|
||||
|
||||
- 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:
|
||||
msg: "Your current ansible module has the version '{{ playbook_version_number }}' and is outdated. Please update it!"
|
||||
when:
|
||||
- playbook_version.content|default("Mgo=")|b64decode|int - 1 >= playbook_version_number|int and submodules_versioncheck|bool
|
||||
|
||||
- name: write new version to remote disk
|
||||
|
@ -38,15 +43,15 @@
|
|||
dnf:
|
||||
name: libselinux-python
|
||||
state: latest
|
||||
when:
|
||||
when:
|
||||
- ansible_distribution == "Fedora"
|
||||
|
||||
- name: install keychain to support ssh agent
|
||||
become: yes
|
||||
package:
|
||||
package:
|
||||
name: keychain
|
||||
state: latest
|
||||
when:
|
||||
when:
|
||||
- ansible_os_family != 'RedHat'
|
||||
- install_keychain|bool
|
||||
|
||||
|
@ -54,7 +59,7 @@
|
|||
become: yes
|
||||
yum:
|
||||
name:
|
||||
- http://packages.psychotic.ninja/7/base/x86_64/RPMS//keychain-2.8.0-3.el7.psychotic.noarch.rpm
|
||||
- http://packages.psychotic.ninja/7/base/x86_64/RPMS//keychain-2.8.0-3.el7.psychotic.noarch.rpm
|
||||
- libselinux-python
|
||||
state: present
|
||||
when:
|
||||
|
@ -128,4 +133,4 @@
|
|||
file:
|
||||
state: absent
|
||||
path: "/root/.bashrc"
|
||||
when: allow_own_root_bashrc == False
|
||||
when: not allow_own_root_bashrc
|
||||
|
|
|
@ -9,5 +9,5 @@ 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_number: 101 # integer without dots
|
||||
playbook_version_path: '/etc/ansible-version/role_dotfiles_chaos-bodensee_github.version'
|
||||
|
|
Loading…
Reference in a new issue