Skip to content

Commit

Permalink
Merge pull request #8 from 532910/ansible-enhancements
Browse files Browse the repository at this point in the history
ansible enhancements
  • Loading branch information
sergio authored Mar 28, 2022
2 parents e5821bc + 183ca76 commit a2c5678
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 21 deletions.
2 changes: 1 addition & 1 deletion defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ neogo__network_opts:
'standby_validators':
- '02b3622bf4017bdfe317c58aed5f4c753f206b7db896046fa7d774bbc4bf7f8dc2'
'seed_list':
- '127.0.0.1:30332'
- 'localhost:30332'

# Default bind address
neogo__bind_address: '0.0.0.0'
Expand Down
6 changes: 3 additions & 3 deletions tasks/binary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
ansible.builtin.get_url:
url: "{{ neogo__bin_url }}"
dest: "{{ neogo__bin_path }}"
mode: '0755'
force: yes
owner: 'root'
group: 'root'
mode: '0755'
when: not (neogo__use_compose | bool)
notify:
- Restart NeoGo service
notify: [ 'Restart NeoGo service' ]
14 changes: 5 additions & 9 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
ansible.builtin.file:
state: directory
path: "{{ neogo__conf_dir }}"
owner: "root"
owner: 'root'
group: "{{ neogo__group }}"
mode: '0750'

Expand All @@ -31,8 +31,7 @@
owner: 'root'
group: '{{ neogo__group }}'
mode: '0640'
notify:
- Restart NeoGo service
notify: [ 'Restart NeoGo service' ]

- name: Copy compose file
ansible.builtin.template:
Expand All @@ -42,24 +41,21 @@
group: "{{ neogo__group }}"
mode: '0640'
when: neogo__use_compose | bool
notify:
- Restart NeoGo service
notify: [ 'Restart NeoGo service' ]

- name: Copy regular systemd unit
ansible.builtin.template:
src: "neogo-legacy.service.bin.j2"
dest: "/etc/systemd/system/neogo{{ neogo__instance }}.service"
when: not (neogo__use_compose | bool)
notify:
- Restart NeoGo service
notify: [ 'Restart NeoGo service' ]

- name: Copy dockerized systemd unit
ansible.builtin.template:
src: "neogo-legacy.service.compose.j2"
dest: "/etc/systemd/system/neogo{{ neogo__instance }}.service"
when: neogo__use_compose | bool
notify:
- Restart NeoGo service
notify: [ 'Restart NeoGo service' ]

- name: Force debops.ferm run
ansible.builtin.include_role:
Expand Down
3 changes: 1 addition & 2 deletions tasks/tls.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,4 @@
group: "{{ neogo__group }}"
mode: '0640'
when: neogo__tls_enabled | bool
notify:
- Restart NeoGo service
notify: [ 'Restart NeoGo service' ]
4 changes: 1 addition & 3 deletions tasks/user.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,16 @@
ansible.builtin.group:
name: "{{ neogo__group }}"
system: yes
state: 'present'

- name: Create NeoGo user
ansible.builtin.user:
name: "{{ neogo__user }}"
group: "{{ neogo__group }}"
password: '*'
shell: /usr/sbin/nologin
shell: '/usr/sbin/nologin'
home: "{{ neogo__data_dir }}"
system: yes
skeleton: no
state: 'present'

- name: Get UID for NeoGo user
ansible.builtin.getent:
Expand Down
5 changes: 2 additions & 3 deletions tasks/wallet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@
content: "{{ neogo__wallet_content }}"
owner: 'root'
group: "{{ neogo__group }}"
mode: '0640'
mode: '0660' # neogo legacy wants write permissions
when: >
(neogo__wallet_content is defined) and
(neogo__wallet_content|length > 0)
notify:
- Restart NeoGo service
notify: [ 'Restart NeoGo service' ]

0 comments on commit a2c5678

Please sign in to comment.