|
|
|
- block:
|
|
|
|
- name: install basic dependencies
|
|
|
|
include_tasks: tasks/pct_command.yml
|
|
|
|
vars:
|
|
|
|
pct_command: "{{ item.pct_command }}"
|
|
|
|
chg_substr: "{{ item.chg_substr | d(omit) }}"
|
|
|
|
loop:
|
|
|
|
- pct_command: apk update
|
|
|
|
- pct_command: apk add python3
|
|
|
|
chg_substr: Installing
|
|
|
|
- pct_command: apk add dropbear
|
|
|
|
chg_substr: Installing
|
|
|
|
- pct_command: rc-update add dropbear
|
|
|
|
chg_substr: added to runlevel
|
|
|
|
|
|
|
|
- name: install openssh-sftp-server
|
|
|
|
include_tasks: tasks/pct_command.yml
|
|
|
|
vars:
|
|
|
|
pct_command: apk add openssh-sftp-server
|
|
|
|
chg_substr: Installing
|
|
|
|
|
|
|
|
- name: start dropbear
|
|
|
|
include_tasks: tasks/pct_command.yml
|
|
|
|
vars:
|
|
|
|
pct_command: service dropbear start
|
|
|
|
chg_substr: \* Starting dropbear ... [ ok ]
|
|
|
|
|
|
|
|
when: (container_distro | lower) == 'alpine'
|
|
|
|
|
|
|
|
|
|
|
|
- block:
|
|
|
|
- name: install basic dependencies
|
|
|
|
include_tasks: tasks/pct_command.yml
|
|
|
|
vars:
|
|
|
|
pct_command: "{{ item.pct_command }}"
|
|
|
|
chg_substr: "{{ item.chg_substr | default(omit) }}"
|
|
|
|
loop:
|
|
|
|
- pct_command: apt-get --assume-yes update
|
|
|
|
- pct_command: apt-get --assume-yes install python3
|
|
|
|
chg_substr: The following NEW packages
|
|
|
|
- pct_command: apt-get --assume-yes install openssh-server
|
|
|
|
chg_substr: The following NEW packages
|
|
|
|
- pct_command: systemctl enable ssh.service
|
|
|
|
chg_substr: Synchronizing state
|
|
|
|
|
|
|
|
- name: edit sshd config
|
|
|
|
include_tasks: tasks/pct_command.yml
|
|
|
|
vars:
|
|
|
|
pct_command: "sed -i 's/PermitRootLogin prohibit-password/PermitRootLogin yes/g' /etc/ssh/sshd_config"
|
|
|
|
|
|
|
|
- name: start sshd
|
|
|
|
include_tasks: tasks/pct_command.yml
|
|
|
|
vars:
|
|
|
|
pct_command: systemctl start ssh.service
|
|
|
|
|
|
|
|
when: (container_distro | lower) in ['debian', 'ubuntu']
|