Skip to content

Commit

Permalink
Initial commit.
Browse files Browse the repository at this point in the history
  • Loading branch information
engonzal committed May 25, 2018
0 parents commit b691559
Show file tree
Hide file tree
Showing 8 changed files with 90 additions and 0 deletions.
36 changes: 36 additions & 0 deletions README.md
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
2 changes: 2 additions & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
# defaults file for ansible_role_package
2 changes: 2 additions & 0 deletions handlers/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
# handlers file for ansible_role_package
22 changes: 22 additions & 0 deletions meta/main.yml
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
19 changes: 19 additions & 0 deletions tasks/main.yml
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 }}"
2 changes: 2 additions & 0 deletions tests/inventory
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
localhost

5 changes: 5 additions & 0 deletions tests/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
- hosts: localhost
remote_user: root
roles:
- ansible_role_package
2 changes: 2 additions & 0 deletions vars/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
# vars file for ansible_role_package

0 comments on commit b691559

Please sign in to comment.