ansible/remnanode: роль на основе node_setup.sh + Ansible Vault для секретов
This commit is contained in:
29
ansible/roles/remnanode/tasks/main.yml
Normal file
29
ansible/roles/remnanode/tasks/main.yml
Normal file
@@ -0,0 +1,29 @@
|
||||
---
|
||||
- name: Copy node setup script
|
||||
copy:
|
||||
src: node_setup.sh
|
||||
dest: /root/node_setup.sh
|
||||
mode: '0700'
|
||||
|
||||
- name: Fill SECRET_KEY in script
|
||||
lineinfile:
|
||||
path: /root/node_setup.sh
|
||||
regexp: '^SECRET_KEY=""'
|
||||
line: 'SECRET_KEY="{{ node_secret_key }}"'
|
||||
|
||||
- name: Fill MY_IP in script
|
||||
lineinfile:
|
||||
path: /root/node_setup.sh
|
||||
regexp: '^MY_IP=".*"'
|
||||
line: 'MY_IP="{{ node_my_ip }}"'
|
||||
|
||||
- name: Fill CrowdSec enroll key
|
||||
lineinfile:
|
||||
path: /root/node_setup.sh
|
||||
regexp: '^cscli console enroll.*'
|
||||
line: 'cscli console enroll {{ node_crowdsec_enroll }}'
|
||||
|
||||
- name: Run node setup script
|
||||
shell: /root/node_setup.sh
|
||||
args:
|
||||
creates: /opt/remnanode/docker-compose.yml
|
||||
Reference in New Issue
Block a user