Skip to content

Commit

Permalink
Fix repository task
Browse files Browse the repository at this point in the history
  • Loading branch information
Irek Glownia committed Apr 14, 2021
1 parent c8d6059 commit 9eb6c40
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG-0.7.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
- [#2164](https://github.com/epiphany-platform/epiphany/issues/2164) - Replace Bintray repository
- [#1888](https://github.com/epiphany-platform/epiphany/issues/1888) - epicli upgrade of cluster created by Epiphany v0.5 may fail
- [#1908](https://github.com/epiphany-platform/epiphany/issues/1908) - Research why Epiphany nodes hang when memory is overcommited
- [#2067](https://github.com/epiphany-platform/epiphany/issues/2067) - [CentOS] epicli fails on task "repository : Wait for yum lock to be released" on CentOS Minimal

### Added

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,26 @@
---
# Bypass yum run by /etc/cron.daily/rhui-update-client on Azure to avoid error 'yum lockfile is held by another process'
- name: Bypass /etc/cron.daily/rhui-update-client
when: specification.provider in ['azure', 'any'] # any for AzBI module
block:
- name: Check if /etc/cron.daily/rhui-update-client file exists
stat:
path: /etc/cron.daily/rhui-update-client
get_attributes: false
get_checksum: false
get_mime: false
register: stat_rhui_update_client_to_bypass

- name: Bypass /etc/cron.daily/rhui-update-client by moving to temporary location # it's restored in teardown
command: mv /etc/cron.daily/rhui-update-client /var/tmp/rhui-update-client
when: stat_rhui_update_client_to_bypass.stat.exists

- name: Wait for yum lock to be released # do not use 'yum' module with 'list' here since it requires yum-utils package
wait_for:
path: /var/run/yum.pid
state: absent
timeout: "{{ yum_lock_timeout }}"

- name: Set SELinux in permissive mode until the machine is rebooted
command: setenforce 0
failed_when: false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,23 @@
- name: Disable epirepo
shell: /tmp/epi-repository-setup-scripts/disable-epirepo-client.sh

- name: Restore /etc/cron.daily/rhui-update-client
when:
- ansible_os_family == "RedHat"
- specification.provider in ['azure', 'any'] # any for AzBI module
block:
- name: Check if /var/tmp/rhui-update-client file exists
stat:
path: /var/tmp/rhui-update-client
get_attributes: false
get_checksum: false
get_mime: false
register: stat_rhui_update_client_to_restore

- name: Restore /etc/cron.daily/rhui-update-client
command: /var/tmp/rhui-update-client mv /etc/cron.daily/rhui-update-client
when: stat_rhui_update_client_to_restore.stat.exists

- name: Remove epirepo packages directory
file:
state: absent
Expand Down

0 comments on commit 9eb6c40

Please sign in to comment.