Externalize role
This commit is contained in:
commit
ee60d76a71
5 changed files with 55 additions and 0 deletions
28
tasks/add_repo_Debian.yml
Normal file
28
tasks/add_repo_Debian.yml
Normal file
|
|
@ -0,0 +1,28 @@
|
||||||
|
---
|
||||||
|
- name: Registering Ubuntu Powershell repository
|
||||||
|
get_url:
|
||||||
|
url: https://packages.microsoft.com/config/ubuntu/{{ ansible_distribution_version }}/prod.list
|
||||||
|
dest: /etc/apt/sources.list.d/microsoft.list
|
||||||
|
owner: root
|
||||||
|
group: root
|
||||||
|
mode: 0644
|
||||||
|
when:
|
||||||
|
- ansible_distribution == "Ubuntu"
|
||||||
|
|
||||||
|
- name: Registering Debian Powershell repository
|
||||||
|
apt_repository:
|
||||||
|
repo: deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-debian-{{ ansible_distribution_name }}-prod {{ ansible_distribution_name }} main
|
||||||
|
filename: microsoft.list
|
||||||
|
state: present
|
||||||
|
update_cache: yes
|
||||||
|
mode: 0644
|
||||||
|
# owner: root
|
||||||
|
# group: root
|
||||||
|
when:
|
||||||
|
- ansible_distribution == "Debian"
|
||||||
|
|
||||||
|
- name: Install public repository GPG keys
|
||||||
|
apt_key:
|
||||||
|
url: /etc/apt/sources.list.d/microsoft.list
|
||||||
|
state:
|
||||||
|
|
||||||
9
tasks/add_repo_RedHat.yml
Normal file
9
tasks/add_repo_RedHat.yml
Normal file
|
|
@ -0,0 +1,9 @@
|
||||||
|
---
|
||||||
|
- name: Registering Powershell repository
|
||||||
|
get_url:
|
||||||
|
url: https://packages.microsoft.com/config/rhel/7/prod.repo
|
||||||
|
dest: /etc/yum.repos.d/microsoft.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='{{ powershell_packages }}' state=latest update_cache=yes
|
||||||
|
|
||||||
4
vars/Debian.yml
Normal file
4
vars/Debian.yml
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
---
|
||||||
|
powershell_packages:
|
||||||
|
- powershell
|
||||||
|
|
||||||
4
vars/RedHat.yml
Normal file
4
vars/RedHat.yml
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
---
|
||||||
|
powershell_packages:
|
||||||
|
- powershell
|
||||||
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue