summaryrefslogtreecommitdiff
path: root/roles/natgw/tasks/main.yml
blob: 9db93b5868592cd607b87670abac5262213ddee1 (plain)
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
---
- name: "copy natgw_rpm_file to destination server"
  synchronize:
    src: "{{ role_path }}/files/rpm/{{ wannat_global.rpm_files.natgw_rpm_file }}"
    dest: "/tmp/"
    
- name: "install natgw"
  yum:
    name: "{{ packages }}"
    state: present
  vars:
    packages:
    - /tmp/{{ wannat_global.rpm_files.natgw_rpm_file }}    
    
- name: "Creates /opt/tsg/wannat/natgw directory"
  file:
    path: /opt/tsg/wannat/natgw
    state: directory

- name: "Creates /opt/tsg/wannat/natgw/conf directory"
  file:
    path: /opt/tsg/wannat/natgw/conf
    state: directory
    
- name: "Template the natgw.conf"
  template:
    src: "{{ role_path }}/templates/natgw.conf.j2"
    dest: /opt/tsg/wannat/natgw/conf/natgw.conf
  tags: template
 
- name: "Template the maat compile table info"
  template:
    src: "{{ role_path }}/templates/compile_tableinfo.conf.j2"
    dest: /opt/tsg/wannat/natgw/conf/compile_tableinfo.conf
  tags: template

- name: "Template the maat plugin table info"
  template:
    src: "{{ role_path }}/templates/plugin_tableinfo.conf.j2"
    dest: /opt/tsg/wannat/natgw/conf/plugin_tableinfo.conf
  tags: template

- name: "Template the monitor script"
  template:
    src: "{{ role_path }}/templates/monit_natgw.j2"
    dest: /opt/tsg/wannat/natgw/monit_natgw
  tags: template  

- name: "add +x to monit_natgw"
  shell: chmod +x /opt/tsg/wannat/natgw/monit_natgw
  args:
    executable: /bin/bash
  tags: shell
  
- name: "run natgw"
  shell: cd /opt/tsg/wannat/natgw; ./run_natgw
  args:
    executable: /bin/bash
  tags: shell