zyregw.yml 1.67 KB
Newer Older
Alexander Withers's avatar
Alexander Withers committed
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
---

- name: Creates /usr/local/src directory
  file: path=/usr/local/src state=directory

- stat: path=/usr/local/gateway
  register: gatewaydir
- name: remove existing gatewaydir
  command: rm -rf /usr/local/gateway
  when: gatewaydir.stat.exists == True
- name: Copy over gateway.s
  synchronize: mode=pull src=gateway.s dest=/usr/local
- name: rename gateway dir
  command: mv /usr/local/gateway.s /usr/local/gateway

- name: Create gateway public keys directory
  file: path=/usr/local/gateway/public_keys state=directory

- name: generate gateway keys
  command: /usr/local/gateway/gateway keygen
  args:
    chdir: "/usr/local/gateway"

- name: Ensure gateway directory is owned by app_user
  command: find /usr/local/gateway -exec chown {{ app_user }}.{{ app_user}} {} \;

27
28
- name: Create sdaiakeys directory
  file: path=/usr/local/sdaiakeys state=directory
Alexander Withers's avatar
Alexander Withers committed
29
- git:
30
31
    repo: https://github.com/ncsa/sdaiakeys
    dest: /usr/local/sdaiakeys
Alexander Withers's avatar
Alexander Withers committed
32
33
34

- copy: src={{ item }} dest=/usr/local/gateway/public_keys
  with_fileglob:
35
    - /usr/local/sdaiakeys/public_keys/*
Alexander Withers's avatar
Alexander Withers committed
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56

- name: systemd services
  template: src=zyre-gateway.service.j2 dest=/etc/systemd/system/zyre-gateway.service owner=root group=root mode=0644
  notify:
    - reload systemd
  when: (ansible_distribution == "CentOS")

- name: systemd services
  template: src=zyre-gateway.service.j2 dest=/etc/systemd/system/zyre-gateway.service owner=root group=root mode=0644
  notify:
    - reload systemd
  when: (ansible_distribution == "Ubuntu")

- name: start zyre
  service: name=zyre-gateway.service state=started

- name: enable zyre gateway services at boot
  service: name=zyre-gateway.service enabled=yes state=started
  notify:
    - reload systemd