Skip to content

Commit

Permalink
UnixPB: add 'changed_when: false' to shell tasks (#2449)
Browse files Browse the repository at this point in the history
  • Loading branch information
Willsparker authored Jun 13, 2022
1 parent c756c16 commit 27adbe4
Show file tree
Hide file tree
Showing 24 changed files with 37 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
- name: Check version of ca-certificates package on the system ...
shell: rpm -q ca-certificates | grep -E 'ca-certificates.2020|ca-certificates.201' warn=no
register: cacertsold
changed_when: false
failed_when: false

- name: Install prereqs for building openssl
Expand All @@ -30,6 +31,7 @@
- name: Verify checksum for CentOS7 OpenSSL 1.0.2k SRPM
shell: sha256sum openssl-1.0.2k-21.el7_9.src.rpm | grep ^6dd850b2be01ff85c500428461019566984d91d7ad8d0002885d33ea37546da4
when: cacertsold.rc == 0
changed_when: false

# Invoking rpm as ansible yum module skips due to non-source RPM presence
- name: Install CentOS7 OpenSSL 1.0.2k SRPM ...
Expand Down Expand Up @@ -73,6 +75,7 @@
- name: Verify checksum for CentOS6 ca-certificates download ...
shell: sha256sum ca-certificates-2020.2.41-65.1.el6_10.src.rpm | grep ^85326e70da937c09d342612190d23d3501a2a46954d2e197f9d343bf060ca000
when: cacertsold.rc == 0
changed_when: false

# Invoking rpm as ansible yum module skips due to non-source RPM presence
- name: Install CentOS6 ca-certificates SRPM ...
Expand All @@ -86,6 +89,7 @@
- name: Verify checksum for CentOS7 ca-certificates download ...
shell: sha256sum ca-certificates-2021.2.50-72.el7_9.src.rpm | grep ^86fe6df26e7612e63a70e435786f2eb6587cb00e6f9927aea113797afacebb57
when: cacertsold.rc == 0
changed_when: false

- name: Extract certdata.txt from CentOS7 ca-certificates SRPM ...
shell: rpm2cpio ca-certificates-2021.2.50-72.el7_9.src.rpm | (cd /root/rpmbuild/SOURCES && cpio -idmv certdata.txt)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@
- name: Get locale list
shell: locale -a
register: localeList
changed_when: False
changed_when: false
tags:
- locales
- skip_ansible_lint
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
- name: Get number of cores on FreeBSD
shell: sysctl hw.ncpu | awk '{print $2}'
register: freebsd_cores
changed_when: false
tags:
- skip_ansible_lint

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
- name: Get macOS version
shell: sw_vers -productVersion
register: macos_version
changed_when: false

- name: Set macos version
set_fact:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@
- name: Get locale list
shell: locale -a
register: localeList
changed_when: False
changed_when: false
tags:
- locales
- skip_ansible_lint
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
shell: pkgutil --version
failed_when: false
register: pkgutil_installed
changed_when: false
tags:
- build_tools

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@
shell: ls -ld /usr/lib/jvm/jdk8* >/dev/null 2>&1
failed_when: false
register: adoptopenjdk_installed
changed_when: false
tags:
- java8_SUSE
- skip_ansible_lint
Expand All @@ -124,6 +125,7 @@
shell: set -o pipefail | ls -ld /usr/lib/jvm/jdk8* 2>/dev/null | awk '{print $9}'
register: adoptopenjdk_dir
when: adoptopenjdk_installed.rc != 0
changed_when: false
tags: java8_SUSE

- name: Chown /usr/lib/jvm/jdk8*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@
##########
# Docker #
##########

- name: Check if docker already exists
command: docker version
failed_when: false
changed_when: false
register: docker_version
tags:
- docker
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
shell: git --version >/dev/null
failed_when: false
register: git_installed
changed_when: false
tags:
- git_source
# Emits 'git used in place of git module'
Expand All @@ -21,6 +22,7 @@
shell: git --version | sed -e 's/git version //g' | awk -F'[.]' '{print $1 "." $2}'
when: git_installed.rc == 0
register: git_version
changed_when: false
tags:
- git_source
# Emits 'git used in place of git module'
Expand Down Expand Up @@ -56,6 +58,7 @@
- name: Find Curl directory
shell: ls -ld /usr/local/curl-* | awk '{print $9}'
register: curl_install_dir
changed_when: false
when:
- (ansible_distribution == "CentOS" and ansible_distribution_major_version == "6")
tags: git_source
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
when:
- not local_vendor_files.stat.exists
run_once: true
changed_when: false

- name: Generate list of remote vendor_files
command: dotgpg cat {{ item }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
- (ansible_distribution == "RedHat" or ansible_distribution == "CentOS" or ansible_distribution == "Ubuntu" or ansible_distribution == "SLES")
- ansible_architecture == "x86_64"
register: openssl_version
changed_when: false
failed_when: false
tags: openssl-1.1.1

Expand All @@ -37,6 +38,7 @@
- name: Convert openssl_latest_release variable
shell: echo {{ openssl_latest_release }} | sed 's/\./_/g'
register: converted_openssl_latest_release
changed_when: false
when:
- (ansible_distribution == "RedHat" or ansible_distribution == "CentOS" or ansible_distribution == "Ubuntu" or ansible_distribution == "SLES")
- ansible_architecture == "x86_64"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
shell: set -o pipefail | hostname | cut -d- -f2
failed_when: false
register: provider_name
changed_when: false
tags:
- providers
- adoptopenjdk
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
- name: Check for Python 2's version
shell: python -V 2>&1 | grep -Po '(?<=Python )(.+)'
register: python_version
changed_when: false
failed_when: false
when:
- (ansible_distribution == "CentOS" or ansible_distribution == "RedHat") and (ansible_distribution_major_version == "6")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
shell: python3 --version >/dev/null
failed_when: false
register: python3_installed
changed_when: false
tags:
- python3_source

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@
shell: ls -ld {{ path }} >/dev/null 2>&1
failed_when: false
register: adoptopenjdk_installed
changed_when: false
tags:
- adoptopenjdk_install
- skip_ansible_lint
Expand Down Expand Up @@ -236,6 +237,7 @@
- name: Get {{ path }}* full path name
shell: set -o pipefail | ls -ld {{ path }}* 2>/dev/null | awk '{print $9}'
register: adoptopenjdk_dir
changed_when: false
when:
- ansible_distribution != "MacOSX"
- adoptopenjdk_installed.rc != 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
shell: ls /usr/local/apache-ant-1.10.5 >/dev/null 2>&1
failed_when: false
register: ant_installed
changed_when: false
tags:
- ant
- skip_ansible_lint
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
- ansible_distribution_major_version == "6"
- ansible_architecture == "x86_64"
register: autoconf_version
changed_when: false
tags: autoconf-2.69

- name: Download Autoconf v2.69
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
shell: ccache --version >/dev/null
failed_when: false
register: ccache_status
changed_when: false
tags: ccache

- name: Download ccache.tar.gz
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
shell: cmake >/dev/null 2>&1
failed_when: false
register: cmake_installed
changed_when: false
tags:
- cmake
- skip_ansible_lint
Expand All @@ -19,6 +20,7 @@
shell: set -o pipefail | cmake --version 2>/dev/null | grep version | awk '{print $3}'
when: cmake_installed.rc == 0
register: cmake_version
changed_when: false
tags: cmake

- name: Download cmake
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
- name: Check curl version
shell: curl --version | head -n1 | awk '{print $2}'
register: curl_version
changed_when: false
tags:
- curl
- skip_ansible_lint
Expand Down Expand Up @@ -88,6 +89,7 @@
- name: Get macOS version
shell: sw_vers -productVersion
register: macos_version
changed_when: false
when:
- ansible_distribution == "MacOSX"
tags: curl
Expand All @@ -112,6 +114,7 @@
- name: Find install directory MacOS
shell: ls -la /usr/local/Cellar/curl/7.*/bin/curl | awk '{print $9}'
register: curl_install_dir
changed_when: false
when:
- ansible_distribution == "MacOSX"
- "macos_version_number is version('10.13', '>')"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
shell: /usr/local/bin/make --version >/dev/null
failed_when: false
register: goodmake_installed
changed_when: false
when:
- ((((ansible_distribution == "SLES" or ansible_distribution == "openSUSE") and ansible_distribution_major_version == "12") or
(ansible_distribution == "Ubuntu" and ansible_distribution_major_version == "14")) and
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
shell: mvn -version >/dev/null 2>&1
failed_when: false
register: maven_installed
changed_when: false
tags:
- maven
- skip_ansible_lint
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
shell: nasm --version >/dev/null 2>&1
failed_when: false
register: nasm_installed
changed_when: false
when: CC is defined
tags: nasm

Expand All @@ -66,6 +67,7 @@
when:
- (nasm_installed.rc is defined) and (nasm_installed.rc == 0 )
register: nasm
changed_when: false
tags: nasm

- name: Download nasm sources
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
shell: ls -ld /usr/lib/jvm/zulu7 2>&1
failed_when: false
register: zulu7_installed
changed_when: false
when:
- ansible_architecture == "x86_64"
- ((ansible_distribution == "Redhat" or ansible_distribution == "CentOS") and (ansible_distribution_major_version|int >= 8)) or
Expand Down

0 comments on commit 27adbe4

Please sign in to comment.