Install and configure an airflow host. Can be used to configure master and worker nodes.
You will require sudo access to the host being provisioned, use the following to run as root.
- name: Provision airflow master hosts
hosts: airflow_hosts
become: yes
roles:
- creditcardscom.airflow
Base airflow configuration variables:
# User airflow should be started under
airflow_user: airflow
# Airflow version to be installed
airflow_version: 1.8.1
# Directory airflow will be installed to
airflow_install_directory: /usr/share/airflow
# Extra packages that will be installed for airflow via pip install
airflow_extra_packages:
- celery
- alldbs
# Services that will be started on the host
airflow_services:
- webserver
- scheduler
- worker
The main airflow configuration happens with yaml objects, which is simply the default configuration default_airflow
gets merged with any overrides found in the airflow
object. All object keys will be templated into the airflow.cfg
under the appropriate section. All values are the default airflow values.
airflow:
core:
dags_folder: "/usr/share/airflow_dags"
base_log_folder: "/var/log/airflow"
webserver:
base_url: "{{ airflow_base_url }}"
scheduler:
statsd_on: True
None
- hosts: airflow-masters
become: yes
roles:
- creditcardscom.airflow
airflow_user: airflow_user
airflow_version: 1.8.0
airflow_services:
- webserver
- scheduler
airflow:
core:
dags_folder: "/home/{{ airflow_user }}/dags"
Copyright (c) 2017 CreditCards.com
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.