Skip to content

Commit 3a7d54f

Browse files
author
kherbik
committed
[issue_6]
- scope['variable'] added (https://puppet.com/docs/puppet/5.3/lang_template_erb.html#scopevariable-or-scopelookupvarvariable) - new variable 'celery_ssl_active = false' for proper celary startup - puppet-lint fixes - contain in the init.pp for proper ordering
1 parent 35e2c8a commit 3a7d54f

File tree

9 files changed

+41
-34
lines changed

9 files changed

+41
-34
lines changed

manifests/config.pp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
ensure => 'present',
99
name => $airflow::group,
1010
gid => $airflow::gid,
11-
} ->
12-
user { $airflow::user:
11+
}
12+
-> user { $airflow::user:
1313
ensure => 'present',
1414
shell => $airflow::shell,
1515
managehome => true,
@@ -49,4 +49,4 @@
4949
mode => '0755',
5050
require => Python::Pip[$airflow::package_name]
5151
}
52-
}
52+
}

manifests/init.pp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@
251251
${::operatingsystem} Release: ${::operatingsystemmajrelease}")
252252
}
253253

254-
include airflow::config,
255-
airflow::install
254+
contain airflow::config
255+
contain airflow::install
256256

257257
}

manifests/params.pp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
$shell = '/bin/bash'
1818
$gid = undef
1919
$uid = undef
20-
$folders_mode = 0775
20+
$folders_mode = '0775'
2121

2222
# General settings
2323
$log_folder = '/var/log/airflow'
@@ -72,7 +72,7 @@
7272
## Scheduler settings
7373
$job_heartbeat_sec = 5
7474
$scheduler_heartbeat_sec = 5
75-
75+
7676
### START hiera lookups ###
7777
$ldap_settings = {}
7878
$statsd_settings = {}

manifests/resource/service.pp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
group => 'root',
99
content => template("${module_name}/${service_name}.service.erb"),
1010
require => [Python::Pip[$airflow::package_name], File[$airflow::log_folder]]
11-
} ~>
12-
Exec['systemctl-daemon-reload']
11+
}
12+
~> Exec['systemctl-daemon-reload']
1313
service { $service_name:
1414
ensure => $airflow::service_ensure,
1515
enable => $airflow::service_enable,

templates/airflow-flower.service.erb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ Wants=basic.target
44
After=basic.target network.target
55

66
[Service]
7-
Environment="AIRFLOW_HOME=<%= @home_folder %>"
8-
User=<%= @user %>
9-
Group=<%= @group %>
7+
Environment="AIRFLOW_HOME=<%= scope['airflow::home_folder'] %>"
8+
User=<%= scope['airflow::user'] %>
9+
Group=<%= scope['airflow::group'] %>
1010
Type=simple
1111
ExecStart=/bin/airflow flower
1212
KillMode=process
1313
Restart=on-failure
1414
RestartSec=15s
1515

1616
[Install]
17-
WantedBy=multi-user.target
17+
WantedBy=multi-user.target

templates/airflow-scheduler.service.erb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@ Wants=basic.target
44
After=basic.target network.target
55

66
[Service]
7-
PIDFile = <%= @run_folder %>/airflow_scheduler.pid
7+
PIDFile = <%= scope['airflow::run_folder'] %>/airflow_scheduler.pid
88
ExecStart=/usr/bin/airflow scheduler
99
ExecReload=/bin/kill -HUP $MAINPID
10-
Environment="AIRFLOW_HOME=<%= @home_folder %>"
10+
Environment="AIRFLOW_HOME=<%= scope['airflow::home_folder'] %>"
1111
KillMode=process
1212
Restart=on-failure
1313
RestartSec=15s
14-
User=<%= @user %>
15-
Group=<%= @group %>
14+
User=<%= scope['airflow::user'] %>
15+
Group=<%= scope['airflow::group'] %>
1616

1717
[Install]
18-
WantedBy=multi-user.target
18+
WantedBy=multi-user.target

templates/airflow-webserver.service.erb

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,15 @@ Wants=basic.target
44
After=basic.target network.target
55

66
[Service]
7-
PIDFile = <%= @run_folder %>/airflow_webserver.pid
8-
ExecStart=/usr/bin/gunicorn -w <%= @gunicorn_workers %> -t 120 -b <%= @web_server_host %>:<%= @web_server_port %> airflow.www.app:cached_app()
7+
PIDFile = <%= scope['airflow::run_folder'] %>/airflow_webserver.pid
8+
ExecStart=/usr/bin/gunicorn -w <%= scope['airflow::gunicorn_workers'] %> -t 120 -b <%= scope['airflow::web_server_host'] %>:<%= scope['airflow::web_server_port'] %> airflow.www.app:cached_app()
99
ExecReload=/bin/kill -HUP $MAINPID
10-
Environment="AIRFLOW_HOME=<%= @home_folder %>"
10+
Environment="AIRFLOW_HOME=<%= scope['airflow::home_folder'] %>"
1111
KillMode=process
1212
Restart=on-failure
1313
RestartSec=15s
14-
User=<%= @user %>
15-
Group=<%= @group %>
14+
User=<%= scope['airflow::user'] %>
15+
Group=<%= scope['airflow::group'] %>
1616

1717
[Install]
1818
WantedBy=multi-user.target
19-
20-
21-
22-
23-

templates/airflow-worker.service.erb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@ Wants=basic.target
44
After=basic.target network.target
55

66
[Service]
7-
PIDFile = <%= @run_folder %>/airflow_worker.pid
7+
PIDFile = <%= scope['airflow::run_folder'] %>/airflow_worker.pid
88
ExecStart=/usr/bin/airflow worker
99
ExecReload=/bin/kill -HUP $MAINPID
10-
Environment="AIRFLOW_HOME=<%= @home_folder %>"
10+
Environment="AIRFLOW_HOME=<%= scope['airflow::home_folder'] %>"
1111
KillMode=process
1212
Restart=on-failure
1313
RestartSec=15s
14-
User=<%= @user %>
15-
Group=<%= @group %>
14+
User=<%= scope['airflow::user'] %>
15+
Group=<%= scope['airflow::group'] %>
1616

1717
[Install]
18-
WantedBy=multi-user.target
18+
WantedBy=multi-user.target

templates/airflow.cfg.erb

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,18 @@ smtp_mail_from = <%= @smtp_mail_from %>
112112
# This section only applies if you are using the CeleryExecutor in
113113
# [core] section above
114114

115+
# Enable / Disable CeleryExecutor with SSL.
116+
# Ensure you properly generate client and server certs and keys.
117+
#
118+
# TODO:
119+
# * configure 'celery_ssl_active' by params
120+
# * setup an SSL key and certs
121+
#
122+
# celery_ssl_cacert = <%= @celery_ssl_cacert %>
123+
# celery_ssl_cert = <%= @celery_ssl_cert %>
124+
# celery_ssl_key = <%= @celery_ssl_key %>
125+
celery_ssl_active = false
126+
115127
# The app name that will be used by celery
116128
celery_app_name = <%= @celery_app_name %>
117129

@@ -202,4 +214,4 @@ authenticate = <%= @mesos_settings['authenticate'] %>
202214
default_principal = <%= @mesos_settings['default_principal'] %>
203215
default_secret = <%= @mesos_settings['default_secret'] %>
204216
<% end %>
205-
<% end %>
217+
<% end %>

0 commit comments

Comments
 (0)