Add ansible playbook to automate service provider setup #10

Merged
nabarun merged 31 commits from deep-stack/testnet-ops:ag-sp-setup into main 2024-10-01 12:17:11 +00:00
4 changed files with 34 additions and 7 deletions
Showing only changes of commit 7151afa3f9 - Show all commits

2
service-provider-setup/.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
dns-vars.yml
k8s-vars.yml

View File

@ -1,5 +0,0 @@
domain: "test.wireitin.com"
subdomain_prefix: "dss-ind"
subdomain_cluster_control: "{{ subdomain_prefix }}-cluster-control"
cluster_control_ip: "64.227.134.44"
do_api_token: ""

View File

@ -0,0 +1,3 @@
target_host: ""
gpg_key_id: ""
vault_passphrase: ""

View File

@ -4,8 +4,8 @@
- name: Setup k8s - name: Setup k8s
hosts: "{{ target_host }}" hosts: "{{ target_host }}"
vars: vars_files:
target_host: "localhost" - k8s-vars.yml
tasks: tasks:
- name: Install Python and pip - name: Install Python and pip
@ -29,3 +29,30 @@
line: 'export PATH="$HOME/.local/bin:$PATH"' line: 'export PATH="$HOME/.local/bin:$PATH"'
state: present state: present
create: yes create: yes
- name: Clone the service provider template repo
git:
repo: "https://git.vdb.to/cerc-io/service-provider-template.git"
dest: "{{ ansible_env.HOME }}/service-provider-template"
- name: Update .vault/vault-keys file
lineinfile:
path: "service-provider-template/.vault/vault-keys"
regexp: '^.*$'
line: "{{ gpg_key_id }}"
create: yes
- name: Start GPG agent
command: gpg-agent --daemon
ignore_errors: yes
- name: Set VAULT_KEY environment variable
shell: export VAULT_KEY='{{ vault_passphrase }}'
- name: Run vault-rekey.sh
expect:
command: bash .vault/vault-rekey.sh
responses:
"Enter passphrase:": "{{ vault_passphrase }}"
args:
chdir: "service-provider-template"