generated from the-liberated-edge/wikijs
i-1 Introduces an Ansible playbook for linux-container with SSH access #2
@ -22,11 +22,11 @@
|
||||
ipv4: "{{ ipv4 | regex_search('([0-9]+.[0-9]+.[0-9]+.[0-9]+)') }}"
|
||||
- name: load root password from environment variable
|
||||
ansible.builtin.set_fact:
|
||||
root_pwd: "{{ lookup('ansible.builtin.env', 'LTE_CONTAINER_ROOT_PWD') }}"
|
||||
pwd: "{{ lookup('ansible.builtin.env', 'LTE_CONTAINER_ROOT_PWD') }}"
|
||||
- name: connect via ssh to linux container
|
||||
ansible.builtin.shell:
|
||||
cmd: |
|
||||
sshpass -p{{ root_pwd }} ssh -o ConnectTimeout=1 root@{{ ipv4 }} exit;
|
||||
sshpass -p{{ pwd }} ssh -o ConnectTimeout=1 root@{{ ipv4 }} exit;
|
||||
register: ssh
|
||||
- name: verify ssh connection to linux container
|
||||
ansible.builtin.assert:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user