Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v1.7.4 to master #59

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ tests/__pycache__
.molecule
.cache
.vagrant
tests/roles
tests/roles
Pipfile*
14 changes: 7 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
---
language: python
python: "2.7.13"
python: "2.7.15"
sudo: required
group: deprecated-2017Q4

env:
- PIPENV_IGNORE_VIRTUALENVS=1

services:
- docker

install:
- pip install ansible==2.4.2.0
- pip install molecule==1.25.0
- pip install ansible-lint==3.4.20
- pip install docker
- pip install pipenv==2018.11.26
- pipenv install -r test-requirements.txt
script:
- molecule test --driver docker
- pipenv run molecule test

notifications:
webhooks: https://galaxy.ansible.com/api/v1/notifications/
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ This project adheres to [Semantic Versioning](http://semver.org/) and [Keep a ch

## [Unreleased](https://github.com/idealista/airflow-role/tree/develop)

## [1.7.4](https://github.com/idealista/airflow-role/tree/1.7.4)
[Full Changelog](https://github.com/idealista/airflow-role/compare/1.7.3...1.7.4)
### Fixed
- *[#47](https://github.com/idealista/airflow-role/issues/50) Fix deprecation warning from jinja templates @adrimarteau

## [1.7.3](https://github.com/idealista/airflow-role/tree/1.7.3)
[Full Changelog](https://github.com/idealista/airflow-role/compare/1.7.2...1.7.3)
### Fixed
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ END OF TERMS AND CONDITIONS

APPENDIX: How to apply the Apache License to your work

Copyright 2018 Idealista S.A.U.
Copyright 2019 Idealista S.A.U.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
13 changes: 6 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ This ansible role installs a Apache Airflow server in a Debian/Ubuntu environmen

## Getting Started

These instructions will get you a copy of the role for your ansible playbook. Once launched, it will install a [Apache Airflow](https://airflow.incubator.apache.org/) server in a Debian or Ubuntu system.
These instructions will get you a copy of the role for your ansible playbook. Once launched, it will install a [Apache Airflow](https://airflow.apache.org/) server in a Debian or Ubuntu system.

### Prerequisities

Ansible 2.4.1.0 version installed.
Ansible 2.4.5.0 version installed.
Inventory destination should be a Debian or Ubuntu environment.

For testing purposes, [Molecule](https://molecule.readthedocs.io/) with [Vagrant](https://www.vagrantup.com/) as driver (with [landrush](https://github.com/vagrant-landrush/landrush) plugin) and [VirtualBox](https://www.virtualbox.org/) as provider.
For testing purposes, [Molecule](https://molecule.readthedocs.io/) with [Docker](https://www.docker.com/) as driver.

### Installing

Expand Down Expand Up @@ -75,14 +75,13 @@ airflow_required_python_packages:
## Testing

```
molecule test --platform=Debian9
pipenv install -r test-requirements.txt --python 2.7
pipenv run molecule test
```

See molecule.yml to check possible testing platforms.

## Built With

![Ansible](https://img.shields.io/badge/ansible-2.4.1.0-green.svg)
![Ansible](https://img.shields.io/badge/ansible-2.4.5.0-green.svg)

## Versioning

Expand Down
5 changes: 1 addition & 4 deletions meta/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,9 @@
galaxy_info:
company: Idealista S.A.U.
description: Apache Airflow role
min_ansible_version: 2.4.1.0
min_ansible_version: 2.4.5.0
license: Apache 2.0
platforms:
- name: Debian
versions:
- stretch
- name: Ubuntu
versions:
- xenial
95 changes: 0 additions & 95 deletions molecule.yml

This file was deleted.

9 changes: 9 additions & 0 deletions molecule/default/Dockerfile.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Molecule managed

{% if item.registry is defined %}
FROM {{ item.registry.url }}/{{ item.image }}
{% else %}
FROM {{ item.image }}
{% endif %}

RUN if [ $(command -v apt-get) ]; then apt-get update && apt-get upgrade -y && apt-get install -y python sudo bash ca-certificates systemd systemd-sysv && apt-get clean; fi
File renamed without changes.
33 changes: 33 additions & 0 deletions molecule/default/molecule.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
dependency:
name: galaxy
driver:
name: docker
lint:
name: yamllint
enabled: False

platforms:
- name: airflow-${MOLECULE_DISTRO:-stretch}
image: debian:${MOLECULE_DISTRO:-stretch}
privileged: true
capabilities:
- SYS_ADMIN
volumes:
- '/sys/fs/cgroup:/sys/fs/cgroup:ro'
groups:
- airflow
command: '/lib/systemd/systemd'

provisioner:
name: ansible
lint:
name: ansible-lint
enabled: False
scenario:
name: default
verifier:
name: goss
lint:
name: yamllint
enabled: False
6 changes: 6 additions & 0 deletions molecule/default/playbook.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---

- name: Converge
hosts: all
roles:
- role: airflow-role
56 changes: 56 additions & 0 deletions molecule/default/verify.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
---
# This is an example playbook to execute goss tests.
# Tests need distributed to the appropriate ansible host/groups
# prior to execution by `goss validate`.

- name: Verify
hosts: all
become: true
vars:
goss_version: v0.3.6
goss_arch: amd64
goss_dst: /usr/local/bin/goss
goss_url: "https://github.com/aelsabbahy/goss/releases/download/{{ goss_version }}/goss-linux-{{ goss_arch }}"
goss_test_directory: /tmp
goss_format: documentation

vars_files:
- ../../defaults/main.yml
- ./group_vars/airflow/main.yml

tasks:
- name: Download and install Goss
get_url:
url: "{{ goss_url }}"
dest: "{{ goss_dst }}"
mode: 0755
register: download_goss
until: download_goss is succeeded
retries: 3

- name: Copy Goss tests to remote
template:
src: "{{ item }}"
dest: "{{ goss_test_directory }}/{{ item | basename }}"
with_fileglob:
- "{{ lookup('env', 'MOLECULE_VERIFIER_TEST_DIRECTORY') }}/test_*.yml"

- name: Register test files
shell: "ls {{ goss_test_directory }}/test_*.yml"
register: test_files

- name: Execute Goss tests
command: "{{ goss_dst }} -g {{ item }} validate --format {{ goss_format }} --retry-timeout 2s"
register: test_results
with_items: "{{ test_files.stdout_lines }}"

- name: Display details about the Goss results
debug:
msg: "{{ item.stdout_lines }}"
with_items: "{{ test_results.results }}"

- name: Fail when tests fail
fail:
msg: "Goss failed to validate"
when: item.rc != 0
with_items: "{{ test_results.results }}"
8 changes: 3 additions & 5 deletions tasks/install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,9 @@

- name: Airflow | Installing dependencies
apt:
pkg: "{{ item }}"
pkg: "{{ airflow_required_libs }}"
state: present
update_cache: yes
with_items: "{{ airflow_required_libs }}"

- name: Airflow | Installing Python pip dependencies
pip:
Expand Down Expand Up @@ -71,9 +70,8 @@
- name: Airflow | Installing Airflow Extra Packages
pip:
executable: "{{ airflow_pip_executable }}"
name: apache-airflow[{{ item }}]
name: apache-airflow[{{ airflow_extra_packages }}]
version: "{{ airflow_version }}"
with_items: "{{ airflow_extra_packages }}"
when: airflow_extra_packages

- name: Airflow | Installing DAGs dependencies
Expand Down Expand Up @@ -104,4 +102,4 @@
mode: 0644
notify: restart {{ item.key }}
with_dict: "{{ airflow_services }}"
when: "{{ item.value.enabled }}"
when: item.value.enabled
2 changes: 1 addition & 1 deletion tasks/service.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
enabled: "{{ item.value.enabled }}"
daemon_reload: yes
with_dict: "{{ airflow_services }}"
when: "{{ item.value.enabled }}"
when: item.value.enabled
changed_when: false
3 changes: 3 additions & 0 deletions test-requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
ansible==2.4.5.0
molecule==2.20.1
docker==3.7.2
31 changes: 0 additions & 31 deletions tests/goss/verifier.yml

This file was deleted.

11 changes: 0 additions & 11 deletions tests/playbook.yml

This file was deleted.