This repository has been archived on 2025-09-14. You can view files and clone it, but cannot push or open issues or pull requests.
Files
solutions-tsg-scripts/roles/sapp/tasks/main.yml

105 lines
2.8 KiB
YAML
Raw Normal View History

2020-01-08 20:02:59 +08:00
---
- name: "copy sapp to destination server"
copy:
src: "{{ role_path }}/files/"
dest: /tmp/ansible_deploy/
2020-09-21 18:33:10 +08:00
- name: "copy maat_redis_tool to destination server"
copy:
src: "{{ role_path }}/files/maat_redis_tool"
dest: /usr/local/bin
2020-09-23 14:07:56 +08:00
mode: 0755
2020-09-21 18:33:10 +08:00
2020-01-08 20:02:59 +08:00
- name: "install sapp rpms from localhost"
yum:
name:
2021-06-01 16:16:07 +08:00
- /tmp/ansible_deploy/sapp-4.2.35.b0d7518-2.el7.x86_64.rpm
2021-01-31 22:43:40 +08:00
state: present
- name: "install tcpdump_mesa rpms from localhost"
yum:
name:
- /tmp/ansible_deploy/tcpdump_mesa-1.0.4.4ef2936-2.el7.x86_64.rpm
2020-01-08 20:02:59 +08:00
state: present
2020-05-22 11:08:29 +08:00
skip_broken: yes
2020-01-08 20:02:59 +08:00
2020-05-22 11:08:29 +08:00
- name: "mkdir tsgconf"
2020-04-01 10:31:23 +08:00
file:
path: /home/mesasoft/sapp_run/tsgconf
state: directory
2020-01-08 20:02:59 +08:00
- name: Template the sapp.toml
template:
src: "{{ role_path }}/templates/sapp.toml.j2"
dest: /home/mesasoft/sapp_run/etc/sapp.toml
tags: template
- name: Template the project_list.conf
template:
src: "{{ role_path }}/templates/project_list.conf.j2"
dest: /home/mesasoft/sapp_run/etc/project_list.conf
tags: template
- name: Template the conflist.inf
template:
src: "{{ role_path }}/templates/conflist.inf.j2"
dest: /home/mesasoft/sapp_run/plug/conflist.inf
tags: template
2021-01-29 18:03:04 +08:00
- name: Template the sapp_log.conf
template:
src: "{{ role_path }}/templates/sapp_log.conf.j2"
dest: /home/mesasoft/sapp_run/etc/sapp_log.conf
tags: template
2021-01-31 22:43:40 +08:00
- name: Template the sapp_tmpfile.conf
template:
src: "{{ role_path }}/templates/sapp_tmpfile.conf.j2"
dest: /etc/tmpfiles.d/sapp_tmpfile.conf
tags: template
2020-01-08 20:02:59 +08:00
- name: Template the gdev.conf
template:
src: "{{ role_path }}/templates/gdev.conf.j2"
dest: /home/mesasoft/sapp_run/etc/gdev.conf
when: tsg_access_type == 1
2021-01-31 22:43:40 +08:00
- name: Template the vlan_flipping_map.conf
template:
src: "{{ role_path }}/templates/vlan_flipping_map.conf.j2"
dest: /home/mesasoft/sapp_run/etc/vlan_flipping_map.conf
when: tsg_access_type == 2
2020-06-09 13:10:38 +08:00
2020-09-10 20:12:17 +08:00
- name: "Template sapp.service destination server"
template:
src: "{{ role_path }}/templates/sapp.service.j2"
dest: /usr/lib/systemd/system/sapp.service
2020-06-09 13:10:38 +08:00
mode: 0755
2021-01-31 22:43:40 +08:00
- name: "copy memory limit file to sapp.service.d"
copy:
src: "{{ role_path }}/files/memory.conf"
dest: /etc/systemd/system/sapp.service.d/
mode: 0644
- name: "copy fake promisc tools for tera mode - service file"
copy:
src: "{{ role_path }}/files/tera_fake_promisc_setup.conf"
dest: /etc/systemd/system/sapp.service.d/
mode: 0644
when: tsg_access_type == 2
- name: "copy fake promisc tools for tera mode - scripts"
copy:
src: "{{ role_path }}/files/tera_fake_promisc_setup.sh"
dest: /home/mesasoft/sapp_run/tera_fake_promisc_setup.sh
mode: 0755
when: tsg_access_type == 2
2020-01-08 20:02:59 +08:00
- name: "enable sapp"
systemd:
name: sapp
enabled: yes
daemon_reload: yes