2022-10-19 20:47:05 +08:00
|
|
|
---
|
|
|
|
- name: Check that amzn2-extras.repo exists
|
|
|
|
stat:
|
|
|
|
path: /etc/yum.repos.d/amzn2-extras.repo
|
|
|
|
register: amzn2_extras_file_stat
|
|
|
|
|
|
|
|
- name: Find docker repo in amzn2-extras.repo file
|
|
|
|
lineinfile:
|
|
|
|
dest: /etc/yum.repos.d/amzn2-extras.repo
|
|
|
|
line: "[amzn2extra-docker]"
|
2024-08-28 13:30:56 +08:00
|
|
|
check_mode: true
|
2022-10-19 20:47:05 +08:00
|
|
|
register: amzn2_extras_docker_repo
|
|
|
|
when:
|
|
|
|
- amzn2_extras_file_stat.stat.exists
|
|
|
|
|
|
|
|
- name: Remove docker repository
|
2023-06-26 18:15:45 +08:00
|
|
|
community.general.ini_file:
|
2022-10-19 20:47:05 +08:00
|
|
|
dest: /etc/yum.repos.d/amzn2-extras.repo
|
|
|
|
section: amzn2extra-docker
|
|
|
|
option: enabled
|
|
|
|
value: "0"
|
2024-08-28 13:30:56 +08:00
|
|
|
backup: true
|
2024-07-26 09:42:20 +08:00
|
|
|
mode: "0644"
|
2022-10-19 20:47:05 +08:00
|
|
|
when:
|
|
|
|
- amzn2_extras_file_stat.stat.exists
|
|
|
|
- not amzn2_extras_docker_repo.changed
|