Something went wrong on our end
-
Nicolas KAROLAK authoredNicolas KAROLAK authored
main.yml 3.20 KiB
---
- name: proxy
when:
- proxy_http | d()
- proxy_https | d()
include_role:
name: proxy
- name: install requirements
apt:
force_apt_get: true
install_recommends: false
name: "{{ conf_req_packages }}"
- name: clone envsetup repository
ignore_errors: true
register: conf_clone
git:
repo: "{{ conf_repo_url }}"
version: "{{ conf_repo_version }}"
dest: "{{ conf_repo_dest }}"
- name: ask to continue
when: conf_clone is failed
pause:
prompt: "Previous task failed, it may be normal if you have local changes in the commited files, do you want to continue anyway?"
seconds: 30
- name: generate root ssh key pair
register: conf_root
user:
name: root
generate_ssh_key: true
ssh_key_type: ed25519
ssh_key_file: .ssh/id_ed25519
- name: check if auto-generated-conf.sh exists
check_mode: false
register: check_conf
stat:
path: "{{ conf_repo_dest }}/auto-generated-conf.sh"
- name: check if conf.sh exists
check_mode: false
register: check_local_conf
stat:
path: "{{ conf_repo_dest }}/conf.sh"
- name: download conf and update ssh public key with activation key
when: skyreach_activation_key | d(false)
register: conf_dl_ak
changed_when: conf_dl_ak.status == 200
failed_when:
- conf_dl_ak.status != 200
- not check_conf.stat.exists
- not skyreach_system_key
uri:
url: https://{{ conf_host }}/erp/credentials/envsetup-conf.sh
method: POST
body_format: form-urlencoded
body:
key: "{{ skyreach_activation_key }}"
public_key: "{{ conf_root.ssh_public_key }}"
return_content: true
validate_certs: "{{ conf_valid_cert }}"
- name: download conf and update ssh public key with system key
when:
- not check_conf.stat.exists or conf_update