diff --git a/.ansible-lint b/.ansible-lint new file mode 100644 index 0000000..c1648fc --- /dev/null +++ b/.ansible-lint @@ -0,0 +1,2 @@ +skip_list: + - '403' diff --git a/tasks/main.yml b/tasks/main.yml index af914b6..3b24d70 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -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 diff --git a/vars/main.yml b/vars/main.yml index 6dcd60e..3478221 100644 --- a/vars/main.yml +++ b/vars/main.yml @@ -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'