First commit
This commit is contained in:
commit
dcad60614c
6 changed files with 64 additions and 0 deletions
6
files/yum-ansible.repo
Normal file
6
files/yum-ansible.repo
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
[ansible]
|
||||
name=Ansible
|
||||
baseurl=https://releases.ansible.com/ansible/rpm/release/epel-7-x86_64/
|
||||
enabled=1
|
||||
gpgcheck=0
|
||||
#gpgkey=releases.ansible.com/ansible/rpm/ansible.asc
|
||||
29
tasks/add_repo_Debian.yml
Normal file
29
tasks/add_repo_Debian.yml
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
---
|
||||
- name: Registering Ubuntu Ansible repository
|
||||
apt_repository:
|
||||
repo: ppa:ansible/ansible
|
||||
state: present
|
||||
update_cache: yes
|
||||
when:
|
||||
- ansible_distribution == "Ubuntu"
|
||||
|
||||
- name: Registering Debian Ansible repository
|
||||
apt_repository:
|
||||
repo: deb http://ppa.launchpad.net/ansible/ansible/ubuntu {{ ansible_distribution_name }} main
|
||||
filename: ansible.list
|
||||
state: present
|
||||
update_cache: yes
|
||||
mode: 0644
|
||||
# owner: root
|
||||
# group: root
|
||||
when:
|
||||
- ansible_distribution == "Debian"
|
||||
|
||||
- name: Install public repository Ansible GPG keys
|
||||
apt_key:
|
||||
keyserver: keyserver.ubuntu.com
|
||||
id: 93C4A3FD7BB9C367
|
||||
state: present
|
||||
when:
|
||||
- ansible_distribution == "Debian"
|
||||
|
||||
11
tasks/add_repo_RedHat.yml
Normal file
11
tasks/add_repo_RedHat.yml
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
---
|
||||
#- name: Registering Ansible repository
|
||||
# get_url:
|
||||
# url: https://releases.ansible.com/ansible/rpm/ansible.repo
|
||||
# dest: /etc/yum.repos.d/ansible.repo
|
||||
# owner: root
|
||||
# group: root
|
||||
# mode: 0644
|
||||
|
||||
- name: Registering Ansible repository
|
||||
copy: src=yum-ansible.repo dest=/etc/yum.repos.d/ansible.repo owner=root group=root mode=0644
|
||||
10
tasks/main.yml
Normal file
10
tasks/main.yml
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
---
|
||||
- name: Include vars for {{ ansible_os_family }}
|
||||
include_vars: "{{ ansible_os_family }}.yml"
|
||||
|
||||
- name: Define repo for {{ ansible_os_family }}
|
||||
include_tasks: add_repo_{{ ansible_os_family }}.yml
|
||||
|
||||
- name: Install packages
|
||||
package: name='{{ ansible_packages }}' state=latest update_cache=yes
|
||||
|
||||
4
vars/Debian.yml
Normal file
4
vars/Debian.yml
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
---
|
||||
ansible_packages:
|
||||
- ansible
|
||||
|
||||
4
vars/RedHat.yml
Normal file
4
vars/RedHat.yml
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
---
|
||||
ansible_packages:
|
||||
- ansible
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue