Skip to content

Commit

Permalink
Merge pull request #3 from Oefenweb/consistency-changes
Browse files Browse the repository at this point in the history
Consistency changes
  • Loading branch information
tersmitten authored Oct 26, 2022
2 parents 85b7d90 + 9644dc7 commit 747057a
Show file tree
Hide file tree
Showing 7 changed files with 46 additions and 34 deletions.
1 change: 0 additions & 1 deletion .ansible-lint
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,3 @@
warn_list:
- role-name
- name[casing]
- '306'
7 changes: 3 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ jobs:
python-version: '3.x'

- name: Install test dependencies
run: pip install ansible-lint[community,yamllint]
run: |
pip install ansible-lint
ansible-galaxy install -r requirements.yml
- name: Lint code
run: |
Expand All @@ -43,11 +45,8 @@ jobs:
matrix:
include:
- distro: debian8
ansible-version: '<2.10'
- distro: debian9
- distro: debian10
- distro: ubuntu1604
ansible-version: '>=2.9, <2.10'
- distro: ubuntu1604
ansible-version: '>=2.10, <2.11'
- distro: ubuntu1604
Expand Down
13 changes: 8 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
FROM ubuntu:16.04
FROM ubuntu:18.04
MAINTAINER Mischa ter Smitten <mtersmitten@oefenweb.nl>

ENV LANG C.UTF-8
ENV LC_ALL C.UTF-8

# python
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y python-minimal python-dev curl && \
DEBIAN_FRONTEND=noninteractive apt-get install -y python3-minimal python3-dev curl && \
apt-get clean
RUN curl -sL https://bootstrap.pypa.io/pip/2.7/get-pip.py | python -
RUN curl -sL https://bootstrap.pypa.io/pip/3.6/get-pip.py | python3 -
RUN rm -rf $HOME/.cache

# ansible
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y gcc libffi-dev libssl-dev && \
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y python3-apt && \
apt-get clean
RUN pip install ansible==2.9.15
RUN pip3 install ansible==2.10.7
RUN rm -rf $HOME/.cache

# provision
Expand Down
5 changes: 2 additions & 3 deletions meta/main.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
# meta file
---
galaxy_info:
namespace: oefenweb
author: oefenweb
role_name: gnu_parallel
author: Mischa ter Smitten
company: Oefenweb.nl B.V.
description: Set up the latest version of GNU Parallel in Debian-like systems
license: MIT
min_ansible_version: 2.9.0
min_ansible_version: 2.10.0
platforms:
- name: Ubuntu
versions:
Expand Down
6 changes: 6 additions & 0 deletions molecule/default/collections.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
collections:
- name: community.docker
version: '>=1.2.0,<2'
- name: community.general
version: '>=2,<3'
3 changes: 3 additions & 0 deletions requirements.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# requirements file
---
collections: []
45 changes: 24 additions & 21 deletions tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# tasks file
---
- name: install dependencies
apt:
ansible.builtin.apt:
name: "{{ gnu_parallel_dependencies }}"
state: "{{ apt_install_state | default('latest') }}"
update_cache: true
Expand All @@ -13,7 +13,7 @@
- gnu-parallel-install-dependencies

- name: remove (distro version)
apt:
ansible.builtin.apt:
name: parallel
state: absent
purge: true
Expand All @@ -25,7 +25,7 @@
- gnu-parallel-remove-distro

- name: create (download) directory
file:
ansible.builtin.file:
path: "{{ gnu_parallel_download_path }}"
state: directory
owner: root
Expand All @@ -38,7 +38,7 @@
- gnu-parallel-install-download

- name: download (latest)
get_url:
ansible.builtin.get_url:
url: "{{ gnu_parallel_download_url }}"
dest: "{{ gnu_parallel_download_path }}/{{ gnu_parallel_download_url | basename }}"
owner: root
Expand All @@ -52,7 +52,7 @@
- gnu-parallel-install-download

- name: create (build) directory
file:
ansible.builtin.file:
path: "{{ gnu_parallel_build_path }}"
state: directory
owner: root
Expand All @@ -64,8 +64,8 @@
- gnu-parallel-install
- gnu-parallel-install-build

- name: version check
shell: >
- name: version check # noqa risky-shell-pipe
ansible.builtin.shell: >
tar -jtf {{ gnu_parallel_download_path }}/{{ gnu_parallel_download_url | basename }} | head -n 1
args:
warn: false
Expand All @@ -78,7 +78,7 @@
- gnu-parallel-install-build

- name: extract
unarchive:
ansible.builtin.unarchive:
src: "{{ gnu_parallel_download_path }}/{{ gnu_parallel_download_url | basename }}"
dest: "{{ gnu_parallel_build_path }}"
creates: "{{ gnu_parallel_build_path }}/{{ _version_check.stdout }}"
Expand All @@ -90,41 +90,44 @@
- gnu-parallel-install
- gnu-parallel-install-build

- block:
- name: install # noqa no-handler
when: _unarchive is changed
tags:
- configuration
- gnu-parallel
- gnu-parallel-install
- gnu-parallel-install-build
block:

- name: configure
command: >
ansible.builtin.command: >
./configure
args:
chdir: "{{ gnu_parallel_build_path }}/{{ _version_check.stdout }}"
changed_when: true
tags:
- gnu-parallel-install-build-configure

- name: make
command: >
ansible.builtin.command: >
make -j{{ ansible_processor_cores + 1 }}
args:
chdir: "{{ gnu_parallel_build_path }}/{{ _version_check.stdout }}"
changed_when: true
tags:
- gnu-parallel-install-build-make

- name: make install
command: >
ansible.builtin.command: >
make install
args:
chdir: "{{ gnu_parallel_build_path }}/{{ _version_check.stdout }}"
changed_when: true
tags:
- gnu-parallel-install-build-make-install

when: _unarchive is changed
tags:
- configuration
- gnu-parallel
- gnu-parallel-install
- gnu-parallel-install-build

- name: silence citation notice
copy:
ansible.builtin.copy:
src: root/.parallel
dest: "{{ ansible_env.HOME }}/"
owner: "{{ ansible_env.USER }}"
Expand All @@ -136,7 +139,7 @@
- gnu-parallel-silence-citation-notice

- name: verify
command: >
ansible.builtin.command: >
parallel --version
changed_when: false
tags:
Expand Down

0 comments on commit 747057a

Please sign in to comment.