-
-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Issue #7: Better package management setup.
- Loading branch information
1 parent
c17bf5e
commit 33a2d8d
Showing
8 changed files
with
50 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
--- | ||
- name: Converge | ||
hosts: all | ||
become: true | ||
|
||
vars: | ||
ansible_install_method: pip | ||
ansible_install_version_pip: "2.6.2" | ||
|
||
roles: | ||
- role: geerlingguy.pip | ||
- role: geerlingguy.ansible |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
--- | ||
- role: geerlingguy.pip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,27 @@ | ||
--- | ||
- name: Set the package state based on how Ansible is installed. | ||
set_fact: | ||
ansible_package_state: "{{ 'present' if ansible_install_method == 'package' else 'absent' }}" | ||
|
||
# Setup/install tasks. | ||
- include_tasks: setup-RedHat.yml | ||
- name: Set up Ansible on RedHat. | ||
include_tasks: setup-RedHat.yml | ||
when: | ||
- ansible_install_method == 'package' | ||
- ansible_os_family == 'RedHat' | ||
- ansible_distribution != 'Fedora' | ||
|
||
- include_tasks: setup-Fedora.yml | ||
when: | ||
- ansible_install_method == 'package' | ||
- ansible_distribution == 'Fedora' | ||
- name: Set up Ansible on Fedora. | ||
include_tasks: setup-Fedora.yml | ||
when: ansible_distribution == 'Fedora' | ||
|
||
- include_tasks: setup-Ubuntu.yml | ||
when: | ||
- ansible_install_method == 'package' | ||
- ansible_distribution == 'Ubuntu' | ||
- name: Set up Ansible on Ubuntu. | ||
include_tasks: setup-Ubuntu.yml | ||
when: ansible_distribution == 'Ubuntu' | ||
|
||
- include_tasks: setup-Debian.yml | ||
when: | ||
- ansible_install_method == 'package' | ||
- ansible_distribution == 'Debian' | ||
- name: Set up Ansible on Debian. | ||
include_tasks: setup-Debian.yml | ||
when: ansible_distribution == 'Debian' | ||
|
||
- include_tasks: setup-pip.yml | ||
when: | ||
- ansible_install_method == 'pip' | ||
- name: Set up Ansible using Pip. | ||
include_tasks: setup-pip.yml | ||
when: ansible_install_method == 'pip' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
--- | ||
- name: Install Ansible. | ||
package: name=ansible state=present | ||
package: | ||
name: ansible | ||
state: "{{ ansible_package_state }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
--- | ||
- name: Install Ansible. | ||
yum: name=ansible state=present enablerepo=epel | ||
yum: | ||
name: ansible | ||
state: "{{ ansible_package_state }}" | ||
enablerepo: epel |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
- name: Install Ansible via Pip. | ||
pip: | ||
name: ansible | ||
version: "{{ ansible_install_version_pip | default(omit) }}" |