From cab94cf5e3f8e1c0b44640b8ef3d10ec0e180534 Mon Sep 17 00:00:00 2001 From: David Mateo Date: Thu, 3 Mar 2022 12:13:36 +0100 Subject: [PATCH 1/3] Fix molecule default scenario - change psycopg2 to use the binary option - Fix typos - Add anisble-lint config - Update Readme --- .ansible-lint | 5 +++++ .yamllint | 6 +++--- CHANGELOG.md | 15 +++++++++++++-- README.md | 14 +++++++++++--- defaults/main/airflow-cfg.yml | 2 +- defaults/main/main.yml | 2 +- defaults/main/webserver-config-py.yml | 10 +++++----- .../default/group_vars/airflow_group/main.yml | 4 ++-- 8 files changed, 41 insertions(+), 17 deletions(-) create mode 100644 .ansible-lint diff --git a/.ansible-lint b/.ansible-lint new file mode 100644 index 0000000..f8b5615 --- /dev/null +++ b/.ansible-lint @@ -0,0 +1,5 @@ +exclude_paths: + - ./molecule +parseable: true +use_default_rules: true +verbosity: 1 diff --git a/.yamllint b/.yamllint index fe1769f..63c313d 100644 --- a/.yamllint +++ b/.yamllint @@ -20,7 +20,7 @@ rules: commas: max-spaces-after: -1 level: error - comments: disable + comments: enable comments-indentation: disable document-start: disable empty-lines: @@ -31,8 +31,8 @@ rules: indentation: enable key-duplicates: enable line-length: disable - new-line-at-end-of-file: disable + new-line-at-end-of-file: enable new-lines: type: unix - trailing-spaces: disable + trailing-spaces: enable truthy: disable diff --git a/CHANGELOG.md b/CHANGELOG.md index 04e055c..3e92a5e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,14 +5,25 @@ This project adheres to [Semantic Versioning](http://semver.org/) and [Keep a ch ## [Unreleased](https://github.com/idealista/airflow-role/tree/develop) - +### Fixed + +- :hammer_and_wrench: change psycopg2 to use the binary option to fix broken build +- :hammer_and_wrench: Fix typos + +### Added + +- :heavy_plus_sign: Add anisble-lint config file + +### Changed + +- :arrows_clockwise: Update Readme ## [2.0.4](https://github.com/idealista/airflow-role/tree/2.0.4) [Full Changelog](https://github.com/idealista/airflow-role/compare/2.0.3...2.0.4) ### Fixed -- Wrong webserver.pid path in template gunicorn-logrotate.j2 [#110](https://github.com/idealista/airflow-role/issues/110) @ginolegigot +- :hammer_and_wrench: Wrong webserver.pid path in template gunicorn-logrotate.j2 [#110](https://github.com/idealista/airflow-role/issues/110) @ginolegigot ## [2.0.3](https://github.com/idealista/airflow-role/tree/2.0.3) diff --git a/README.md b/README.md index 043b705..f5e541e 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,6 @@ -# Apache Airflow Ansible role [![Build Status](https://travis-ci.org/idealista/airflow-role.png)](https://travis-ci.org/idealista/airflow-role) +# Apache Airflow Ansible role + +![GitHub release (latest by date)](https://img.shields.io/github/v/release/idealista/airflow-role?color=%23B62682) [![Ansible Galaxy](https://img.shields.io/badge/galaxy-idealista.clickhouse_role-B62682.svg)](https://galaxy.ansible.com/idealista/clickhouse_role) [![Build Status](https://travis-ci.org/idealista/airflow-role.png)](https://travis-ci.org/idealista/airflow-role) ![Logo](https://raw.githubusercontent.com/idealista/airflow-role/master/logo.gif) @@ -111,9 +113,15 @@ airflow_extra_packages: ## Testing :test_tube: -```shell +```bash pipenv install -r test-requirements.txt --python 3.7 -pipenv run molecule test + +# Optional +pipenv shell # if in shell just use `molecule COMMAND` + +pipenv run molecule test # To run role test +# or +pipenv run molecule converge # To run play with the role ``` ## Built With :building_construction: diff --git a/defaults/main/airflow-cfg.yml b/defaults/main/airflow-cfg.yml index 677a9f8..aac7afb 100644 --- a/defaults/main/airflow-cfg.yml +++ b/defaults/main/airflow-cfg.yml @@ -156,7 +156,7 @@ airflow_webserver_access_logformat: airflow_webserver_expose_config: False airflow_webserver_expose_hostname: True airflow_webserver_expose_stacktrace: True -airflow_webserver_dag_default_view: tree # Valid values are: tree, graph, duration, gantt, landing_times +airflow_webserver_dag_default_view: tree # Valid values are: tree, graph, duration, gantt, landing_times airflow_webserver_dag_orientation: LR airflow_webserver_log_fetch_timeout_sec: 5 airflow_webserver_log_fetch_delay_sec: 2 diff --git a/defaults/main/main.yml b/defaults/main/main.yml index 1c8b4a2..334f543 100644 --- a/defaults/main/main.yml +++ b/defaults/main/main.yml @@ -25,7 +25,7 @@ airflow_constraint_url: "https://raw.githubusercontent.com/apache/airflow/constr # https://airflow.apache.org/docs/apache-airflow/stable/extra-packages-ref.html # List should follow Ansible's YAML basics: # https://docs.ansible.com/ansible/latest/reference_appendices/YAMLSyntax.html#yaml-basics -airflow_bundle_package: # all|all_dbs|devel|devel_hadoop|devel_all|devel_ci See bundle extras section +airflow_bundle_package: # all|all_dbs|devel|devel_hadoop|devel_all|devel_ci See bundle extras section # airflow_extra_packages: # [Apache] # - apache.atlas diff --git a/defaults/main/webserver-config-py.yml b/defaults/main/webserver-config-py.yml index 72a751f..b0cd7f8 100644 --- a/defaults/main/webserver-config-py.yml +++ b/defaults/main/webserver-config-py.yml @@ -23,12 +23,12 @@ airflow_AUTH_LDAP_LASTNAME_FIELD: sn airflow_AUTH_LDAP_EMAIL_FIELD: mail # if null in LDAP, email is set to: "{username}@email.notfound" # search configs -airflow_AUTH_LDAP_SEARCH: # the LDAP search base -airflow_AUTH_LDAP_UID_FIELD: # the username field -airflow_AUTH_LDAP_BIND_USER: # the special bind username for search -airflow_AUTH_LDAP_BIND_PASSWORD: # the special bind password for search +airflow_AUTH_LDAP_SEARCH: # the LDAP search base +airflow_AUTH_LDAP_UID_FIELD: # the username field +airflow_AUTH_LDAP_BIND_USER: # the special bind username for search +airflow_AUTH_LDAP_BIND_PASSWORD: # the special bind password for search -airflow_AUTH_LDAP_SEARCH_FILTER: # limit the LDAP search scope +airflow_AUTH_LDAP_SEARCH_FILTER: # limit the LDAP search scope # Setup Full admin role name airflow_AUTH_ROLE_ADMIN: Admin diff --git a/molecule/default/group_vars/airflow_group/main.yml b/molecule/default/group_vars/airflow_group/main.yml index cdcdb63..c768a37 100644 --- a/molecule/default/group_vars/airflow_group/main.yml +++ b/molecule/default/group_vars/airflow_group/main.yml @@ -32,8 +32,8 @@ airflow_regular_users: email: eren@attack.com airflow_required_python_packages: - - { name: SQLAlchemy, version: 1.3.23 } - - { name: psycopg2 } + - { name: SQLAlchemy, version: 1.3.23 } # see https://github.com/apache/airflow/blob/main/setup.cfg#L157-L161 + - { name: psycopg2-binary } # [smtp] airflow_smtp_host: localhost From b9bcbb091ddaea0d0bd0b2462dff7f01042ef48d Mon Sep 17 00:00:00 2001 From: David Mateo Date: Thu, 3 Mar 2022 13:51:57 +0100 Subject: [PATCH 2/3] Fix molecule extra scenario - Change psycopg2 to use the binary option --- molecule/extra_packages/group_vars/airflow_group/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/molecule/extra_packages/group_vars/airflow_group/main.yml b/molecule/extra_packages/group_vars/airflow_group/main.yml index d1bf123..f08a5b6 100644 --- a/molecule/extra_packages/group_vars/airflow_group/main.yml +++ b/molecule/extra_packages/group_vars/airflow_group/main.yml @@ -14,7 +14,7 @@ airflow_admin_users: airflow_required_python_packages: - { name: SQLAlchemy, version: 1.3.23 } - - { name: psycopg2 } + - { name: psycopg2-binary } airflow_extra_packages: - celery From cf314580e86af913853a8dcbf7e1fcfcaa0783e4 Mon Sep 17 00:00:00 2001 From: David Mateo Date: Mon, 7 Mar 2022 13:12:15 +0100 Subject: [PATCH 3/3] Update CHANGELOG.md --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3e92a5e..11bb98c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,10 @@ This project adheres to [Semantic Versioning](http://semver.org/) and [Keep a ch ## [Unreleased](https://github.com/idealista/airflow-role/tree/develop) +## [2.0.5](https://github.com/idealista/airflow-role/tree/2.0.5) + +[Full Changelog](https://github.com/idealista/airflow-role/compare/2.0.4...2.0.5) + ### Fixed - :hammer_and_wrench: change psycopg2 to use the binary option to fix broken build