Update ansible code
Some checks reported errors
continuous-integration/drone/push Build encountered an error
Some checks reported errors
continuous-integration/drone/push Build encountered an error
This commit is contained in:
parent
e33e55cd8c
commit
d8e47cba66
8 changed files with 39 additions and 39 deletions
|
|
@ -10,7 +10,9 @@ galaxy_info:
|
||||||
version:
|
version:
|
||||||
- 7
|
- 7
|
||||||
- 8
|
- 8
|
||||||
|
- 9
|
||||||
- name: RedHat
|
- name: RedHat
|
||||||
version:
|
version:
|
||||||
- 7
|
- 7
|
||||||
- 8
|
- 8
|
||||||
|
- 9
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
---
|
---
|
||||||
- name: Registering Ubuntu Ansible repository
|
- name: Registering Ubuntu Ansible repository
|
||||||
apt_repository:
|
ansible.builtin.apt_repository:
|
||||||
repo: ppa:ansible/ansible
|
repo: ppa:ansible/ansible
|
||||||
state: present
|
state: present
|
||||||
update_cache: yes
|
update_cache: yes
|
||||||
|
|
@ -8,22 +8,21 @@
|
||||||
- ansible_distribution == "Ubuntu"
|
- ansible_distribution == "Ubuntu"
|
||||||
|
|
||||||
- name: Registering Debian Ansible repository
|
- name: Registering Debian Ansible repository
|
||||||
apt_repository:
|
ansible.builtin.apt_repository:
|
||||||
repo: deb http://ppa.launchpad.net/ansible/ansible/ubuntu {{ ansible_distribution_name }} main
|
repo: deb http://ppa.launchpad.net/ansible/ansible/ubuntu {{ ansible_distribution_name }} main
|
||||||
filename: ansible.list
|
filename: ansible.list
|
||||||
state: present
|
state: present
|
||||||
update_cache: yes
|
update_cache: yes
|
||||||
mode: 0644
|
mode: "0644"
|
||||||
# owner: root
|
# owner: root
|
||||||
# group: root
|
# ansible.builtin.group: root
|
||||||
when:
|
when:
|
||||||
- ansible_distribution == "Debian"
|
- ansible_distribution == "Debian"
|
||||||
|
|
||||||
- name: Install public repository Ansible GPG keys
|
- name: Install public repository Ansible GPG keys
|
||||||
apt_key:
|
ansible.builtin.apt_key:
|
||||||
keyserver: keyserver.ubuntu.com
|
keyserver: keyserver.ubuntu.com
|
||||||
id: 93C4A3FD7BB9C367
|
id: 93C4A3FD7BB9C367
|
||||||
state: present
|
state: present
|
||||||
when:
|
when:
|
||||||
- ansible_distribution == "Debian"
|
- ansible_distribution == "Debian"
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,19 +1,19 @@
|
||||||
---
|
---
|
||||||
#- name: Registering Ansible repository
|
# - name: Registering Ansible repository
|
||||||
# get_url:
|
# ansible.builtin.get_url:
|
||||||
# url: https://releases.ansible.com/ansible/rpm/ansible.repo
|
# url: https://releases.ansible.com/ansible/rpm/ansible.repo
|
||||||
# dest: /etc/yum.repos.d/ansible.repo
|
# dest: /etc/yum.repos.d/ansible.repo
|
||||||
# owner: root
|
# owner: root
|
||||||
# group: root
|
# ansible.builtin.group: root
|
||||||
# mode: 0644
|
# mode: 0644
|
||||||
|
|
||||||
- name: Registering Ansible repository
|
- name: Registering Ansible repository
|
||||||
copy:
|
ansible.builtin.copy:
|
||||||
src: yum-ansible.repo
|
src: yum-ansible.repo
|
||||||
dest: /etc/yum.repos.d/ansible.repo
|
dest: /etc/yum.repos.d/ansible.repo
|
||||||
owner: root
|
owner: root
|
||||||
group: root
|
ansible.builtin.group: root
|
||||||
mode: 0644
|
mode: "0644"
|
||||||
when:
|
when:
|
||||||
- "ansible_distribution == 'CentOS' or ansible_distribution == 'RedHat'"
|
- "ansible_distribution == 'CentOS' or ansible_distribution == 'RedHat'"
|
||||||
- "ansible_distribution_major_version < '8'"
|
- "ansible_distribution_major_version < '8'"
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,13 @@
|
||||||
---
|
---
|
||||||
- name: Define repo for {{ ansible_os_family }}
|
- name: Define repo for {{ ansible_os_family }}
|
||||||
include_tasks: add_repo_{{ ansible_os_family }}.yml
|
ansible.builtin.include_tasks: add_repo_{{ ansible_os_family }}.yml
|
||||||
tags:
|
tags:
|
||||||
- config
|
- config
|
||||||
|
|
||||||
- name: Install packages
|
- name: Install packages
|
||||||
package:
|
ansible.builtin.package:
|
||||||
name: '{{ ansible_packages }}'
|
name: '{{ ansible_packages }}'
|
||||||
state: present
|
state: present
|
||||||
update_cache: yes
|
update_cache: true
|
||||||
tags:
|
tags:
|
||||||
- installation
|
- installation
|
||||||
|
|
|
||||||
|
|
@ -1,15 +1,15 @@
|
||||||
---
|
---
|
||||||
- block:
|
- block:
|
||||||
- name: Include vars for {{ ansible_os_family }}
|
- name: Include vars for {{ ansible_os_family }}
|
||||||
include_vars: "{{ ansible_os_family }}.yml"
|
ansible.builtin.include_vars: "{{ ansible_os_family }}.yml"
|
||||||
|
|
||||||
- name: Install Ansible
|
- name: Install Ansible
|
||||||
include_tasks: "install.yml"
|
ansible.builtin.include_tasks: "install.yml"
|
||||||
when:
|
when:
|
||||||
- not ansible_uninstall|bool
|
- not ansible_uninstall|bool
|
||||||
|
|
||||||
- name: UnInstall Ansible
|
- name: UnInstall Ansible
|
||||||
include_tasks: "uninstall.yml"
|
ansible.builtin.include_tasks: "uninstall.yml"
|
||||||
when:
|
when:
|
||||||
- ansible_uninstall|bool
|
- ansible_uninstall|bool
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,30 +1,30 @@
|
||||||
---
|
---
|
||||||
- name: Remove Ansible's files
|
- name: Remove Ansible's files
|
||||||
file:
|
ansible.builtin.file:
|
||||||
path: "/etc/yum.repos.d/ansible.repo"
|
path: "/etc/yum.repos.d/ansible.repo"
|
||||||
state: absent
|
state: absent
|
||||||
when:
|
when:
|
||||||
- ansible_os_family == 'RedHat'
|
- ansible_os_family == 'RedHat'
|
||||||
|
|
||||||
- name: Registering Ubuntu Ansible repository
|
- name: Registering Ubuntu Ansible repository
|
||||||
apt_repository:
|
ansible.builtin.apt_repository:
|
||||||
repo: ppa:ansible/ansible
|
repo: ppa:ansible/ansible
|
||||||
state: absent
|
state: absent
|
||||||
update_cache: yes
|
update_cache: true
|
||||||
when:
|
when:
|
||||||
- ansible_distribution == "Ubuntu"
|
- ansible_distribution == "Ubuntu"
|
||||||
|
|
||||||
- name: Registering Debian Ansible repository
|
- name: Registering Debian Ansible repository
|
||||||
apt_repository:
|
ansible.builtin.apt_repository:
|
||||||
repo: deb http://ppa.launchpad.net/ansible/ansible/ubuntu {{ ansible_distribution_name }} main
|
repo: deb http://ppa.launchpad.net/ansible/ansible/ubuntu {{ ansible_distribution_name }} main
|
||||||
filename: ansible.list
|
filename: ansible.list
|
||||||
state: absent
|
state: absent
|
||||||
update_cache: yes
|
update_cache: true
|
||||||
when:
|
when:
|
||||||
- ansible_distribution == "Debian"
|
- ansible_distribution == "Debian"
|
||||||
|
|
||||||
- name: Remove Ansible's packages
|
- name: Remove Ansible's packages
|
||||||
package:
|
ansible.builtin.package:
|
||||||
name: '{{ ansible_packages }}'
|
name: '{{ ansible_packages }}'
|
||||||
state: absent
|
state: absent
|
||||||
update_cache: yes
|
update_cache: true
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,3 @@
|
||||||
---
|
---
|
||||||
ansible_packages:
|
ansible_packages:
|
||||||
- ansible
|
- ansible
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue