128 lines
4.8 KiB
YAML
128 lines
4.8 KiB
YAML
---
|
|
|
|
- name: Create tixstream group
|
|
group:
|
|
name: "{{ smbgroup }}"
|
|
state: present
|
|
|
|
- name: create tixstream user
|
|
user:
|
|
name: "{{ smbuser }}"
|
|
shell: /bin/bash
|
|
groups: "{{ smbgroup }}"
|
|
append: yes
|
|
|
|
- name: create deployment directory
|
|
file: path={{ remote_deployment_dir }} state=directory
|
|
|
|
- include_tasks: mft-ubuntu-24.yml
|
|
when: ansible_distribution == "Ubuntu" and ansible_facts['distribution_version'] == "24.04"
|
|
|
|
- name: Print the package name
|
|
debug:
|
|
msg: "The box is {{ package_to_install }}"
|
|
|
|
- unarchive:
|
|
src: "{{ package_to_install.path }}"
|
|
dest: "{{ remote_deployment_dir }}"
|
|
when: oldpackage is undefined and newpackage is undefined
|
|
|
|
- unarchive:
|
|
src: "{{ package_to_install }}"
|
|
dest: "{{ remote_deployment_dir }}"
|
|
when: oldpackage is defined or newpackage is defined
|
|
|
|
- name: List unarchived MFT bundle directory
|
|
find:
|
|
paths: "{{ remote_deployment_dir }}"
|
|
patterns: "tixstream-mft-ubuntu*"
|
|
file_type: directory
|
|
register: found_directories
|
|
|
|
- name: Get latest unarchived MFT bundle directory
|
|
set_fact:
|
|
package_dir: "{{ found_directories.files | sort(attribute='mtime',reverse=true) | first }}"
|
|
|
|
- name: Check if an old version should be deployed (install script has different name)
|
|
stat: path={{ package_dir.path }}/install_mft_bundle.sh
|
|
register: old_install_script
|
|
|
|
- name: Set the correct name of the install script
|
|
set_fact:
|
|
install_script: "{{'install_mft_bundle.sh' if old_install_script.stat.exists else 'install.sh'}}"
|
|
|
|
- name: Execute MFT install script
|
|
command: "{{ package_dir.path }}/{{ install_script }} --assumeyes -u {{ smbuser }} -g {{ smbgroup }}"
|
|
|
|
- name: Set name to the nodes name in transfer-job-manager config
|
|
lineinfile:
|
|
dest: "{{ configs.mft_services.transfer_job_manager.config }}"
|
|
regexp: '^custom.transfer-job-manager.name.*$'
|
|
line: "custom.transfer-job-manager.name={{ item.value.name }}"
|
|
state: present
|
|
when: item.value.hostname == ansible_fqdn and item.value.contains_setup is defined and "mft" in item.value.contains_setup
|
|
with_dict: "{{ configs.host_config }}"
|
|
|
|
- name: Set hostname to the nodes hostname in transfer-job-manager config for a normal MFT node
|
|
lineinfile:
|
|
dest: "{{ configs.mft_services.transfer_job_manager.config }}"
|
|
regexp: '^custom.transfer-job-manager.hostname.*$'
|
|
line: "custom.transfer-job-manager.hostname={{ item.value.hostname }}"
|
|
state: present
|
|
when: item.value.hostname == ansible_fqdn and item.value.contains_setup is defined and "mft" in item.value.contains_setup
|
|
with_dict: "{{ configs.host_config }}"
|
|
|
|
- name: Set hostname to the nodes hostname in transfer-job-manager config for a clustered MFT node
|
|
lineinfile:
|
|
dest: "{{ configs.mft_services.transfer_job_manager.config }}"
|
|
regexp: '^custom.transfer-job-manager.hostname.*$'
|
|
line: "custom.transfer-job-manager.hostname={{ item.value.cluster_hostname }}"
|
|
state: present
|
|
when: item.value.hostname == ansible_fqdn and item.value.contains_setup is defined and "mft-cluster-node" in item.value.contains_setup
|
|
with_dict: "{{ configs.host_config }}"
|
|
|
|
- name: Set transfer-job-manager job scheduling options in the config
|
|
lineinfile:
|
|
dest: "{{ configs.mft_services.transfer_job_manager.config }}"
|
|
regexp: '^{{ item.option }}.*$'
|
|
line: "{{ item.line }}"
|
|
state: present
|
|
with_items: "{{ configs.mft_services.transfer_job_manager.scheduler_properties }}"
|
|
|
|
- name: Set transfer-job-manager sending max-datarate options in the config
|
|
lineinfile:
|
|
dest: "{{ configs.mft_services.transfer_job_manager.config }}"
|
|
regexp: '^custom.transfer-job-manager.default-sending-data-rate'
|
|
line: "custom.transfer-job-manager.default-sending-data-rate=10000000"
|
|
state: present
|
|
|
|
- name: Set transfer-job-manager receiving max-datarate options in the config
|
|
lineinfile:
|
|
dest: "{{ configs.mft_services.transfer_job_manager.config }}"
|
|
regexp: '^custom.transfer-job-manager.default-receiving-data-rate'
|
|
line: "custom.transfer-job-manager.default-receiving-data-rate=10000000"
|
|
state: present
|
|
|
|
- name: Enable transfer-job-manager watch folder feature
|
|
lineinfile:
|
|
dest: "{{ configs.mft_services.transfer_job_manager.config }}"
|
|
regexp: '^{{ item.option }}.*$'
|
|
line: "{{ item.line }}"
|
|
state: present
|
|
with_items: "{{ configs.mft_services.transfer_job_manager.watchfolder_properties }}"
|
|
|
|
# Use command module because service module fails to just 'enable' the services
|
|
- name: Enable MFT services to start on boot for centos
|
|
command: chkconfig {{ item.value.name }} on
|
|
with_dict: "{{ configs.mft_services }}"
|
|
when: (ansible_distribution == 'CentOS')
|
|
|
|
- name: Enable MFT services to start on boot for Ubuntu
|
|
service:
|
|
name: "{{ item.value.name }}"
|
|
enabled: yes
|
|
with_dict: "{{ configs.mft_services }}"
|
|
when: (ansible_distribution == 'Ubuntu')
|
|
|
|
|
|
# vim:ft=ansible
|