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

Nifi #128

Closed
wants to merge 7 commits into from
Closed

Nifi #128

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
15 changes: 15 additions & 0 deletions playbooks/nifi_kerberos_install.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Copyright 2022 TOSIT.IO
# SPDX-License-Identifier: Apache-2.0

---
- name: Kerberos nifi server install
hosts: nifi
strategy: linear
tasks:
- tosit.tdp.resolve:
node_name: nifi_kerberos
- import_role:
name: tosit.tdp_extra.nifi.server
tasks_from: kerberos
- meta: clear_facts

13 changes: 13 additions & 0 deletions playbooks/nifi_server_config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Copyright 2022 TOSIT.IO
# SPDX-License-Identifier: Apache-2.0

---
- name: Config nifi server
hosts: nifi
tasks:
- tosit.tdp.resolve:
node_name: nifi_server
- import_role:
name: tosit.tdp_extra.nifi.server
tasks_from: config
- meta: clear_facts
13 changes: 13 additions & 0 deletions playbooks/nifi_server_install.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Copyright 2022 TOSIT.IO
# SPDX-License-Identifier: Apache-2.0

---
- name: Install nifi server
hosts: nifi
tasks:
- tosit.tdp.resolve:
node_name: nifi_server
- import_role:
name: tosit.tdp_extra.nifi.server
tasks_from: install
- meta: clear_facts
13 changes: 13 additions & 0 deletions playbooks/nifi_server_restart.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Copyright 2022 TOSIT.IO
# SPDX-License-Identifier: Apache-2.0

---
- name: Restart nifi server
hosts: nifi
tasks:
- tosit.tdp.resolve:
node_name: nifi_server
- import_role:
name: tosit.tdp_extra.nifi.server
tasks_from: restart
- meta: clear_facts
13 changes: 13 additions & 0 deletions playbooks/nifi_server_start.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Copyright 2022 TOSIT.IO
# SPDX-License-Identifier: Apache-2.0

---
- name: Start nifi server
hosts: nifi
tasks:
- tosit.tdp.resolve:
node_name: nifi_server
- import_role:
name: tosit.tdp_extra.nifi.server
tasks_from: start
- meta: clear_facts
13 changes: 13 additions & 0 deletions playbooks/nifi_server_stop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Copyright 2022 TOSIT.IO
# SPDX-License-Identifier: Apache-2.0

---
- name: Stop nifi server
hosts: nifi
tasks:
- tosit.tdp.resolve:
node_name: nifi_server
- import_role:
name: tosit.tdp_extra.nifi.server
tasks_from: stop
- meta: clear_facts
45 changes: 45 additions & 0 deletions roles/nifi/server/tasks/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Copyright 2022 TOSIT.IO
# SPDX-License-Identifier: Apache-2.0

---


- name: Template authorizers.xml
template:
src: authorizers.xml.j2
dest: "{{ nifi_conf_dir }}/authorizers.xml"
owner: root
group: root
mode: "644"

- name: Template bootstrap.conf
template:
src: bootstrap.conf.j2
dest: "{{ nifi_conf_dir }}/bootstrap.conf"
owner: root
group: root
mode: "644"

- name: Template login-identity-providers.xml
template:
src: login-identity-providers.xml.j2
dest: "{{ nifi_conf_dir }}/login-identity-providers.xml"
owner: root
group: root
mode: "644"

- name: Template nifi.properties
template:
src: nifi.properties.j2
dest: "{{ nifi_conf_dir }}/nifi.properties"
owner: root
group: root
mode: "644"

- name: Template state-management.xml
template:
src: state-management.xml.j2
dest: "{{ nifi_conf_dir }}/state-management.xml"
owner: root
group: root
mode: "644"
4 changes: 4 additions & 0 deletions roles/nifi/server/tasks/init.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Copyright 2022 TOSIT.IO
# SPDX-License-Identifier: Apache-2.0

---
84 changes: 84 additions & 0 deletions roles/nifi/server/tasks/install.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
# Copyright 2022 TOSIT.IO
# SPDX-License-Identifier: Apache-2.0

---

- include_role:
name: tosit.tdp.utils.group
vars:
group: "{{ nifi_group }}"

- include_role:
name: tosit.tdp.utils.user
vars:
user: "{{ nifi_user }}"
group: "{{ nifi_group }}"

- name: "Upload {{ nifi_dist_file }}"
copy:
src: "files/{{ nifi_dist_file }}"
dest: "{{ binaries_upload_dir }}"
diff: no

- name: "Ensure {{ nifi_root_dir }} exists"
file:
path: "{{ nifi_root_dir }}"
state: directory

- name: "Extract {{ nifi_dist_file }}"
unarchive:
src: "{{ binaries_upload_dir }}/{{ nifi_dist_file }}"
dest: "{{ nifi_root_dir }}"
group: root
owner: root
mode: "755"
remote_src: yes
creates: "{{ nifi_root_dir }}/{{ nifi_release }}"

- name: Create symbolic link to nifi installation
file:
src: "{{ nifi_root_dir }}/{{ nifi_release }}"
dest: "{{ nifi_install_dir }}"
state: link

- name: Create configuration directory
file:
path: "{{ nifi_conf_dir }}"
state: directory
group: "{{ nifi_group }}"
owner: "{{ nifi_user }}"
mode: "755"

- name: Create log directory
file:
path: "{{ nifi_log_dir }}"
state: directory
group: "{{ nifi_group }}"
owner: "{{ nifi_user }}"
mode: "750"

- name: Create pid directory
file:
path: "{{ nifi_install_dir }}/run"
state: directory
group: "{{ nifi_group }}"
owner: "{{ nifi_user }}"
mode: "750"

- name: Create application directories
file:
path: "{{ nifi_install_dir }}/{{item}}"
state: directory
group: "{{ nifi_group }}"
owner: "{{ nifi_user }}"
mode: "750"
loop: "{{ nifi_generated_dirs }}"

- name: Template nifi service file
template:
src: nifi.service.j2
dest: /usr/lib/systemd/system/nifi.service
owner: root
group: root
mode: "644"

37 changes: 37 additions & 0 deletions roles/nifi/server/tasks/kerberos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Copyright 2022 TOSIT.IO
# SPDX-License-Identifier: Apache-2.0

---
- import_role:
name: tosit.tdp.utils.kerberos
tasks_from: install

- name: Template zookeeper-jaas.conf
template:
src: zookeeper-jaas.conf.j2
dest: "{{ nifi_conf_dir }}/zookeeper-jaas.conf"
owner: "{{ nifi_user }}"
group: "{{ nifi_group }}"
mode: "640"

- import_role:
name: tosit.tdp.utils.kerberos
tasks_from: create_principal_keytab
vars:
principal: "nifi/{{ ansible_fqdn }}"
keytab: "nifi.service.keytab"
user: "{{ nifi_user }}"
group: "{{ nifi_group }}"
mode: "600"
when: krb_create_principals_keytabs

- import_role:
name: tosit.tdp.utils.kerberos
tasks_from: check_secure_keytab
vars:
principal: "nifi/{{ ansible_fqdn }}"
keytab: "nifi.service.keytab"
user: "{{ nifi_user }}"
group: "{{ nifi_group }}"
mode: "600"
when: not krb_create_principals_keytabs
10 changes: 10 additions & 0 deletions roles/nifi/server/tasks/restart.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Copyright 2022 TOSIT.IO
# SPDX-License-Identifier: Apache-2.0

---

- name: Restart nifi server
service:
name: nifi
state: restarted
enabled: "{{ nifi_start_on_boot }}"
10 changes: 10 additions & 0 deletions roles/nifi/server/tasks/start.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Copyright 2022 TOSIT.IO
# SPDX-License-Identifier: Apache-2.0

---

- name: Start nifi server
service:
name: nifi
state: started
enabled: "{{ nifi_start_on_boot }}"
10 changes: 10 additions & 0 deletions roles/nifi/server/tasks/stop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Copyright 2022 TOSIT.IO
# SPDX-License-Identifier: Apache-2.0

---

- name: Stop nifi server
service:
name: nifi
state: stopped
enabled: "{{ nifi_start_on_boot }}"
Loading