Skip to content

Commit

Permalink
Merge pull request #2 from blackstar257/add-packages
Browse files Browse the repository at this point in the history
update to support packages
  • Loading branch information
blackstar257 authored Nov 19, 2019
2 parents a0d012a + bd5f87b commit 4729abb
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 5 deletions.
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ env:
- MOLECULE_DISTRO: centos7
- MOLECULE_DISTRO: centos6
- MOLECULE_DISTRO: ubuntu1804
- MOLECULE_DISTRO: ubuntu1604
- MOLECULE_DISTRO: debian9
- MOLECULE_DISTRO: debian8

Expand Down
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,11 @@ This role requires Ansible 2.0 or higher.

## Role Variables

| Name | Default | Description |
| ------------------ | -------------------- | ------------------------- |
| perl_cpanm_version | 1.7907 | The CPAN release version |
| perl_cpanm_path | /usr/local/bin/cpanm | SThe CPAN script location |
| Name | Default | Description |
| ------------------ | -------------------- | ------------------------------------- |
| perl_cpanm_version | 1.7907 | The CPAN release version |
| perl_cpanm_path | /usr/local/bin/cpanm | SThe CPAN script location |
| perl_cpanm_modules | [] | List of modules to install with cpanm |

## Dependencies

Expand Down
1 change: 1 addition & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
perl_cpanm_version: "1.7044"
perl_cpanm_path: "/usr/local/bin/cpanm"
perl_cpanm_url: "https://raw.githubusercontent.com/miyagawa/cpanminus/{{ perl_cpanm_version }}/cpanm"
perl_cpanm_modules: []
13 changes: 13 additions & 0 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,23 @@
name: "{{ perl_packages }}"
state: present

- name: check for cpanm executable
stat:
path: "{{ perl_cpanm_path }}"
register: cpanm_executable

- name: get the cpan script
get_url:
url: "{{ perl_cpanm_url }}"
dest: "{{ perl_cpanm_path }}"
owner: root
group: root
mode: 0755
when: not cpanm_executable.stat.exists

- name: install perl modules
cpanm:
name: "{{ item }}"
executable: "{{ perl_cpanm_path }}"
with_items: "{{ perl_cpanm_modules }}"
when: perl_cpanm_modules|length > 0
3 changes: 3 additions & 0 deletions vars/Debian.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
---
perl_packages:
- perl
- perl-CPAN
- libperl-dev
- make
- gcc
3 changes: 3 additions & 0 deletions vars/RedHat.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
---
perl_packages:
- perl
- perl-CPAN
- perl-devel
- make
- gcc

0 comments on commit 4729abb

Please sign in to comment.