Use async for RPM verification
This patch runs the RPM verification asynchronously to speed up the playbook run. Change-Id: I7e114031cf81f89b6134614ebcff62edc5fafc65
This commit is contained in:
@@ -31,6 +31,24 @@
|
||||
tags:
|
||||
- always
|
||||
|
||||
# Multiple tasks will need the output of RPM verification, so let's do the
|
||||
# lookup one time and then grep over the output in subsequent tasks.
|
||||
- name: Verify all installed RPM packages
|
||||
shell: "rpm -Va > {{ temp_dir }}/rpmverify.txt"
|
||||
args:
|
||||
warn: no
|
||||
failed_when: False
|
||||
changed_when: False
|
||||
register: rpmverify_task
|
||||
async: 300
|
||||
poll: 0
|
||||
when:
|
||||
- not check_mode | bool
|
||||
- ansible_os_family | lower == 'redhat'
|
||||
tags:
|
||||
- always
|
||||
- skip_ansible_lint
|
||||
|
||||
# Package installations and removals must come first so that configuration
|
||||
# changes can be made later.
|
||||
- include: packages.yml
|
||||
|
||||
@@ -13,20 +13,16 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
# Multiple tasks will need the output of RPM verification, so let's do the
|
||||
# lookup one time and then grep over the output in subsequent tasks.
|
||||
- name: Verify all installed RPM packages
|
||||
shell: "rpm -Va > {{ temp_dir }}/rpmverify.txt"
|
||||
args:
|
||||
warn: no
|
||||
- name: Ensure RPM verification task has finished
|
||||
async_status:
|
||||
jid: "{{ rpmverify_task.ansible_job_id }}"
|
||||
failed_when: False
|
||||
changed_when: False
|
||||
register: job_result
|
||||
until: job_result.finished
|
||||
retries: 30
|
||||
when:
|
||||
- not check_mode | bool
|
||||
- ansible_os_family | lower == 'redhat'
|
||||
tags:
|
||||
- always
|
||||
- skip_ansible_lint
|
||||
- not rpmverify_task | skipped
|
||||
|
||||
- name: RHEL-07-010020 - Get files with invalid checksums (rpm)
|
||||
shell: "grep '^..5' {{ temp_dir }}/rpmverify.txt | awk '{ print $NF }'"
|
||||
|
||||
Reference in New Issue
Block a user