-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit b691559
Showing
8 changed files
with
90 additions
and
0 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,36 @@ | ||
### Ansible Roles: Package | ||
|
||
Module to install a list of packages. | ||
|
||
#### Role Variables | ||
For general packages when not using mixed Operating Systems you can use the following: | ||
``` | ||
package_list: | ||
- git | ||
- curl | ||
``` | ||
|
||
If you have mixed Operating Systems you may need to use the following: | ||
``` | ||
package_apt: | ||
- python-dev | ||
package_yum: | ||
- python-devel | ||
``` | ||
|
||
#### Example Playbook | ||
|
||
``` | ||
- hosts: servers | ||
vars: | ||
package_list: | ||
- curl | ||
- htop | ||
roles: | ||
- { role: engonzal.package, tags: [ 'package'] } | ||
``` | ||
|
||
#### License | ||
|
||
BSD |
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 @@ | ||
--- | ||
# defaults file for ansible_role_package |
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 @@ | ||
--- | ||
# handlers file for ansible_role_package |
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,22 @@ | ||
galaxy_info: | ||
author: engonzal | ||
description: Package installation for Linux. | ||
license: license BSD | ||
min_ansible_version: 2.4 | ||
platforms: | ||
- name: GenericUNIX | ||
versions: | ||
- all | ||
- any | ||
- name: GenericBSD | ||
versions: | ||
- all | ||
- any | ||
- name: GenericLinux | ||
versions: | ||
- all | ||
- any | ||
|
||
galaxy_tags: [] | ||
- packages | ||
- base |
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,19 @@ | ||
--- | ||
- name: Install General Packages | ||
package: | ||
name: | ||
state: present | ||
with_items: "{{ package_list }}" | ||
|
||
- name: Install Ubuntu Packages | ||
apt: | ||
update_cache: yes | ||
name: "{{ item }}" | ||
state: present | ||
with_items: "{{ package_apt }}" | ||
|
||
- name: Install CentOS Packages | ||
yum: | ||
name: "{{ item }}" | ||
state: present | ||
with_items: "{{ package_yum }}" |
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 @@ | ||
localhost | ||
|
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 @@ | ||
--- | ||
- hosts: localhost | ||
remote_user: root | ||
roles: | ||
- ansible_role_package |
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 @@ | ||
--- | ||
# vars file for ansible_role_package |