반응형
centos6의 공식 repository가 만료되어 아래와 같이 주소 변경.
---
- name: "Modify CentOS6 Base Repo"
hosts: all
become: true
tasks:
- name: "Modify CentOS6 Base Repo"
replace:
path: /etc/yum.repos.d/CentOS-Base.repo
regexp: "{{ item.origin }}"
replace: "{{ item.replace }}"
with_items:
- { origin: "mirrorlist=http://mirrorlist.centos.org", replace: "#mirrorlist=http://mirrorlist.centos.org" }
- { origin: "#baseurl=http://mirror.centos.org", replace: "baseurl=http://vault.centos.org" }
when:
- ansible_facts['distribution'] == "CentOS"
- ansible_facts['distribution_major_version'] == "6"
- name: "libselinux-python install"
yum:
name: "{{ item }}"
state: installed
loop:
- libselinux-python
참고. 우분투의 경우 https://old-releases.ubuntu.com/ 로 변경
반응형
'Automation Tools > Ansible' 카테고리의 다른 글
8.5 ansible | [playbook] docker 설치 (0) | 2021.03.16 |
---|---|
8.4 ansible | [playbook] nodejs, npm 설치 (0) | 2021.03.16 |
8.2 ansible | [playbook] Linux service 상태 변경 (0) | 2021.03.16 |
8.1 ansible | [playbook] Linux user 추가 (0) | 2021.03.16 |
7. ansible inventory 설정 과 playbook 실행 (0) | 2021.03.16 |