-
Notifications
You must be signed in to change notification settings - Fork 6
/
nifi.yml
119 lines (105 loc) · 3.17 KB
/
nifi.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
---
# We want to be able to sub-select based on tags - this breaks fact gathering for silly reasons:
# https://github.com/ansible/ansible/issues/57529 v2.7->2.8 regression?
- name: nifi facts
hosts: nifi
gather_facts: yes
- hosts: nifi
gather_facts: no
become: yes
tags:
- nifi
pre_tasks:
- include_tasks: tasks/python3-ubuntu.yml
- name: Ensure git is installed
package:
name:
- git
tags:
- git-clone
- name: Add SSH_AUTH_SOCK to sudo user for git clone
lineinfile:
path: /etc/sudoers
regexp: "SSH_AUTH_SOCK"
line: 'Defaults env_keep += "SSH_AUTH_SOCK"'
validate: "visudo -cf %s"
tags:
- git-clone
# Block forces tag on all sub-tasks
- block:
- include_tasks: tasks/generate-ss-certs.yml
vars:
self_signed_certificates: "{{ nifi_self_signed_certificates }}"
when: nifi_use_self_signed | default(False) | bool
tags:
- nginx
- certificates
roles:
- role: nifi
- role: linux-config
when: ansible_connection != 'docker'
- role: certbot
vars:
certbot_create_certs: "{{ nifi_certbot_create_certs }}"
certbot_site_names:
- "{{ nifi_server_name }}"
certbot_mail_address: "{{ nifi_certbot_mail_address }}"
when: nifi_use_certbot
tags:
- nginx
- certificates
- role: nginx
vars:
nginx_install_method: package
nginx_sites: "{{ nifi_nginx_sites }}"
nginx_enabled_sites: "{{ nifi_nginx_enabled_sites }}"
enable_ssl: " {{ nifi_enable_ssl }}"
nginx_basic_auth_files:
- path: "{{ nifi_basic_auth_file }}"
users:
- username: "{{ nifi_basic_auth_name }}"
password: "{{ nifi_password }}"
state: "present"
apt_default_packages:
- ca-certificates
- python3-passlib
tags:
- nginx
tasks:
- block:
- include_tasks: tasks/install-ubuntu-18-duplicity-v08.yml
when: nifi_backup_enabled is not defined or nifi_backup_enabled == true
tags:
- nifi-backup
- name: Install system-wide NiFi dependencies
apt:
pkg: "{{ item }}"
state: latest
update_cache: yes
cache_valid_time: 600
with_items:
- python-pkg-resources
- python-pip
- name: Create nifi Group
group:
name: nifi
- name: Create nifi user
user:
name: nifi
comment: "NiFi User"
system: yes
group: nifi
- name: Download PostgreSQL JDBC drivers
get_url:
url: https://jdbc.postgresql.org/download/postgresql-42.2.1.jar
checksum: sha256:d800ad754c7265b3bc06425d3ea0059a2a3226527226cecfd459f74b0be7d6ed
owner: nifi
group: nifi
dest: "{{ nifi_library_directory }}"
- name: Download mssql JDBC drivers
get_url:
url: https://repo1.maven.org/maven2/com/microsoft/sqlserver/mssql-jdbc/8.4.1.jre8/mssql-jdbc-8.4.1.jre8.jar
owner: nifi
group: nifi
dest: "{{ nifi_library_directory }}"
when: nifi_install_mssql_jdbc_drivers|bool