Skip to content

Commit b1f5b3e

Browse files
authored
Merge pull request #1 from Oefenweb/initial-working-version
Initial working version
2 parents 6b64921 + 0349228 commit b1f5b3e

File tree

15 files changed

+387
-0
lines changed

15 files changed

+387
-0
lines changed

.gitignore

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# OS generated files #
2+
######################
3+
.DS_Store
4+
.DS_Store?
5+
._*
6+
.Spotlight-V100
7+
.Trashes
8+
Icon?
9+
ehthumbs.db
10+
Thumbs.db
11+
12+
# IDE files #
13+
#################
14+
/.settings
15+
/.buildpath
16+
/.project
17+
/nbproject
18+
*.komodoproject
19+
*.kpf
20+
/.idea
21+
22+
# Vagrant files #
23+
.virtualbox/
24+
.vagrant/
25+
vagrant_ansible_inventory_*
26+
ansible.cfg
27+
28+
# Other files #
29+
###############
30+
!empty

.travis.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
---
2+
sudo: required
3+
dist: trusty
4+
5+
language: python
6+
python: "2.7"
7+
8+
env:
9+
- ANSIBLE_VERSION=latest
10+
- ANSIBLE_VERSION=2.2.1.0
11+
- ANSIBLE_VERSION=2.2.0.0
12+
- ANSIBLE_VERSION=2.1.4
13+
- ANSIBLE_VERSION=2.1.3
14+
- ANSIBLE_VERSION=2.1.2
15+
- ANSIBLE_VERSION=2.1.1.0
16+
- ANSIBLE_VERSION=2.1.0.0
17+
- ANSIBLE_VERSION=2.0.2.0
18+
- ANSIBLE_VERSION=2.0.1.0
19+
- ANSIBLE_VERSION=2.0.0.2
20+
- ANSIBLE_VERSION=2.0.0.1
21+
- ANSIBLE_VERSION=2.0.0.0
22+
- ANSIBLE_VERSION=1.9.6
23+
24+
branches:
25+
only:
26+
- master
27+
28+
before_install:
29+
- sudo apt-get update -qq
30+
31+
# Remove parallel
32+
- sudo apt-get remove --purge --yes parallel || true
33+
34+
install:
35+
# Install Ansible.
36+
- if [ "$ANSIBLE_VERSION" = "latest" ]; then pip install ansible; else pip install ansible==$ANSIBLE_VERSION; fi
37+
- if [ "$ANSIBLE_VERSION" = "latest" ]; then pip install ansible-lint; fi
38+
39+
script:
40+
# Check the role/playbook's syntax.
41+
- ansible-playbook -i tests/inventory tests/test.yml --syntax-check
42+
43+
# Run the role/playbook with ansible-playbook.
44+
- ansible-playbook -i tests/inventory tests/test.yml -vvvv
45+
46+
# Run the role/playbook again, checking to make sure it's idempotent.
47+
- >
48+
ansible-playbook -i tests/inventory tests/test.yml
49+
| grep -q 'changed=0.*failed=0'
50+
&& (echo 'Idempotence test: pass' && exit 0)
51+
|| (echo 'Idempotence test: fail' && exit 1)
52+
53+
- if [ "$ANSIBLE_VERSION" = "latest" ]; then ansible-lint tests/test.yml || true; fi
54+
55+
notifications:
56+
email: false
57+
hipchat:
58+
rooms:
59+
secure: Y546OvY1VE/YgT1o+IZYSVR3gO0t1rGVtRGO9/X++xi72y4s1kINnN3v4e2gc+8BAhHsueaqH4QGIHoJeTQ8+LcK9pNBRBmuxI4qzltcCXd5EV3iVuhhynE1IzixtRxYcps7U+T/VdSj/m80ZD4YvLmcD1pVAprCSUJcX8ccJQw3HZ1RuIyO2iIRmLjU6oc6Js+rDCZqie3yVLbRmVQL9O6LI15YWIpO4UPDcXHd26ugmUQTl/BRNaE0ROxVhu2R8OCKbC6ctrv04dog1+EZA3NMEX/L4HbN/7K6JlwC/5Cl840pc6Ned2NihGCkcejpae0UYrpr+BHgDfB/MBAXwqthutyAqtQvIiOV7KIgAJ9ID4+x+4RZYZYg3q5Y2vmGyILRPhzcverZrZTHuKvNxdQMBMs7Xi1/uL3//jrBoN0yD9JhC/hme0A6neGglQTFZWyEjU0T5pIeBJ4lAuG8EKN4WjzoD5LIr03PHO+037N+YjPYsIHMJr8UwaRL8YsBPvKGLyeAwOZnFFuyfUM8W0EIlrDkNVbUx+AS69oYCpUkxpynwZk3ssNZ3CK/yS2wXIfsEPdApk8tbS8FcvLGQvy+i+F5UedEWXgcXtYKuRJ2N2DnO6Z1kFgPcJQ70dDzaSLhXWf/+IUiR0wQHEjL4EtbhGd1kBL09CxjCwffJQI=
60+
webhooks: https://galaxy.ansible.com/api/v1/notifications/

README.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
## gnu-parallel
2+
3+
[![Build Status](https://travis-ci.org/Oefenweb/ansible-gnu-parallel.svg?branch=master)](https://travis-ci.org/Oefenweb/ansible-gnu-parallel) [![Ansible Galaxy](http://img.shields.io/badge/ansible--galaxy-gnu--parallel-blue.svg)](https://galaxy.ansible.com/Oefenweb/gnu-parallel)
4+
5+
Set up the latest version of [GNU Parallel](https://www.gnu.org/software/parallel/) in Debian-like systems.
6+
7+
#### Requirements
8+
9+
None
10+
11+
#### Variables
12+
13+
* `gnu_parallel_remove_distro_version`: [default: `true`]: Whether or not to remove the distribution version
14+
15+
## Dependencies
16+
17+
None
18+
19+
#### Example
20+
21+
```yaml
22+
---
23+
- hosts: all
24+
roles:
25+
- gnu-parallel
26+
```
27+
28+
#### License
29+
30+
MIT
31+
32+
#### Author Information
33+
34+
* Mischa ter Smitten
35+
36+
#### Feedback, bug-reports, requests, ...
37+
38+
Are [welcome](https://github.com/Oefenweb/ansible-gnu-parallel/issues)!

Vagrantfile

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# -*- mode: ruby -*-
2+
# vi: set ft=ruby ts=2 sw=2 tw=0 et :
3+
4+
role = File.basename(File.expand_path(File.dirname(__FILE__)))
5+
6+
boxes = [
7+
{
8+
:name => "ubuntu-1204",
9+
:box => "bento/ubuntu-12.04",
10+
:ip => '10.0.0.11',
11+
:cpu => "50",
12+
:ram => "256"
13+
},
14+
{
15+
:name => "ubuntu-1404",
16+
:box => "bento/ubuntu-14.04",
17+
:ip => '10.0.0.12',
18+
:cpu => "50",
19+
:ram => "256"
20+
},
21+
{
22+
:name => "ubuntu-1604",
23+
:box => "bento/ubuntu-16.04",
24+
:ip => '10.0.0.13',
25+
:cpu => "50",
26+
:ram => "256"
27+
},
28+
{
29+
:name => "debian-711",
30+
:box => "bento/debian-7.11",
31+
:ip => '10.0.0.14',
32+
:cpu => "50",
33+
:ram => "256"
34+
},
35+
{
36+
:name => "debian-86",
37+
:box => "bento/debian-8.6",
38+
:ip => '10.0.0.15',
39+
:cpu => "50",
40+
:ram => "256"
41+
},
42+
]
43+
44+
Vagrant.configure("2") do |config|
45+
boxes.each do |box|
46+
config.vm.define box[:name] do |vms|
47+
vms.vm.box = box[:box]
48+
vms.vm.hostname = "ansible-#{role}-#{box[:name]}"
49+
50+
vms.vm.provider "virtualbox" do |v|
51+
v.customize ["modifyvm", :id, "--cpuexecutioncap", box[:cpu]]
52+
v.customize ["modifyvm", :id, "--memory", box[:ram]]
53+
end
54+
55+
vms.vm.network :private_network, ip: box[:ip]
56+
57+
vms.vm.provision :ansible do |ansible|
58+
ansible.playbook = "tests/vagrant.yml"
59+
ansible.verbose = "vv"
60+
end
61+
end
62+
end
63+
end

defaults/main.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# defaults file for gnu-parallel
2+
---
3+
gnu_parallel_remove_distro_version: true

files/root/.parallel/will-cite

Whitespace-only changes.

handlers/main.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# handlers file for gnu-parallel
2+
---

meta/main.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# meta file for gnu-parallel
2+
---
3+
galaxy_info:
4+
author: Mischa ter Smitten
5+
company: Oefenweb.nl B.V.
6+
description: Set up the latest version of GNU Parallel in Debian-like systems
7+
license: MIT
8+
min_ansible_version: 1.9.6
9+
platforms:
10+
- name: Ubuntu
11+
versions:
12+
- precise
13+
- trusty
14+
- xenial
15+
- name: Debian
16+
versions:
17+
- wheezy
18+
- jessie
19+
galaxy_tags:
20+
- shell
21+
- system
22+
dependencies: []

tasks/main.yml

Lines changed: 136 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,136 @@
1+
# tasks file for gnu-parallel
2+
---
3+
- name: install dependencies
4+
apt:
5+
name: "{{ item }}"
6+
state: "{{ apt_install_state | default('latest') }}"
7+
update_cache: true
8+
cache_valid_time: "{{ apt_update_cache_valid_time | default(3600) }}"
9+
with_items: "{{ gnu_parallel_dependencies }}"
10+
tags:
11+
- configuration
12+
- gnu-parallel
13+
- gnu-parallel-install
14+
- gnu-parallel-install-dependencies
15+
16+
- name: remove (distro version)
17+
apt:
18+
name: parallel
19+
state: absent
20+
purge: true
21+
when: gnu_parallel_remove_distro_version
22+
tags:
23+
- configuration
24+
- gnu-parallel
25+
- gnu-parallel-remove
26+
- gnu-parallel-remove-distro
27+
28+
- name: create (download) directory
29+
file:
30+
path: "{{ gnu_parallel_download_path }}"
31+
state: directory
32+
owner: root
33+
group: root
34+
mode: 0755
35+
tags:
36+
- configuration
37+
- gnu-parallel
38+
- gnu-parallel-install
39+
- gnu-parallel-install-download
40+
41+
- name: download (latest)
42+
get_url:
43+
url: "{{ gnu_parallel_download_url }}"
44+
dest: "{{ gnu_parallel_download_path }}/{{ gnu_parallel_download_url | basename }}"
45+
owner: root
46+
group: root
47+
mode: 0644
48+
force: true
49+
tags:
50+
- configuration
51+
- gnu-parallel
52+
- gnu-parallel-install
53+
- gnu-parallel-install-download
54+
55+
- name: create (build) directory
56+
file:
57+
path: "{{ gnu_parallel_build_path }}"
58+
state: directory
59+
owner: root
60+
group: root
61+
mode: 0755
62+
tags:
63+
- configuration
64+
- gnu-parallel
65+
- gnu-parallel-install
66+
- gnu-parallel-install-build
67+
68+
- name: version check
69+
shell: tar -jtf {{ gnu_parallel_download_path }}/{{ gnu_parallel_download_url | basename }} | head -n 1
70+
changed_when: false
71+
register: _version_check
72+
tags:
73+
- configuration
74+
- gnu-parallel
75+
- gnu-parallel-install
76+
- gnu-parallel-install-build
77+
78+
- name: extract
79+
unarchive:
80+
src: "{{ gnu_parallel_download_path }}/{{ gnu_parallel_download_url | basename }}"
81+
dest: "{{ gnu_parallel_build_path }}"
82+
creates: "{{ gnu_parallel_build_path }}/{{ _version_check.stdout }}"
83+
copy: false
84+
register: _unarchive
85+
tags:
86+
- configuration
87+
- gnu-parallel
88+
- gnu-parallel-install
89+
- gnu-parallel-install-build
90+
91+
- name: configure
92+
command: ./configure
93+
args:
94+
chdir: "{{ gnu_parallel_build_path }}/{{ _version_check.stdout }}"
95+
when: _unarchive | changed
96+
tags:
97+
- configuration
98+
- gnu-parallel
99+
- gnu-parallel-install
100+
- gnu-parallel-install-build
101+
- gnu-parallel-install-build-configure
102+
103+
- name: make
104+
command: make -j{{ ansible_processor_cores + 1 }}
105+
args:
106+
chdir: "{{ gnu_parallel_build_path }}/{{ _version_check.stdout }}"
107+
when: _unarchive | changed
108+
tags:
109+
- configuration
110+
- gnu-parallel
111+
- gnu-parallel-install
112+
- gnu-parallel-install-build
113+
- gnu-parallel-install-build-make
114+
115+
- name: make install
116+
command: make install
117+
args:
118+
chdir: "{{ gnu_parallel_build_path }}/{{ _version_check.stdout }}"
119+
when: _unarchive | changed
120+
tags:
121+
- configuration
122+
- gnu-parallel
123+
- gnu-parallel-install
124+
- gnu-parallel-install-build
125+
- gnu-parallel-install-build-make-install
126+
127+
- name: silence citation notice
128+
copy:
129+
src: root/.parallel
130+
dest: "{{ ansible_env.HOME }}/"
131+
owner: "{{ ansible_env.USER }}"
132+
group: "{{ ansible_env.USER }}"
133+
tags:
134+
- configuration
135+
- gnu-parallel
136+
- gnu-parallel-silence-citation-notice

templates/empty

Whitespace-only changes.

0 commit comments

Comments
 (0)