tests: image_prep fixes.

pull/350/head
David Wilson 6 years ago
parent e1306bb03d
commit e48e32cd0c

@ -73,7 +73,7 @@ also by Ansible's `osx_setup.yml`.
used to target this account, the parent session requires a TTY and the
account password must be entered.
`mitogen__user1` .. `mitogen__user21`
`mitogen__user1` .. `mitogen__user5`
These accounts do not have passwords set. They exist to test the Ansible
interpreter recycling logic.

@ -9,8 +9,12 @@
strategy: mitogen_linear
become: true
vars:
distro: "{{ansible_distribution}}"
ver: "{{ansible_distribution_major_version}}"
special_users:
- has_sudo
- has_sudo_nopw
- has_sudo_pubkey
- pw_required
- readonly_homedir
@ -19,10 +23,10 @@
- slow_user
- webapp
groups:
- has_sudo: ['mitogen__group', '{{sudo_group[distro]}}']
- has_sudo_pubkey: ['mitogen__group', '{{sudo_group[distro]}}']
- has_sudo_nopw: ['mitogen__group', 'mitogen__sudo_nopw']
user_groups:
has_sudo: ['mitogen__group', '{{sudo_group[distro]}}']
has_sudo_pubkey: ['mitogen__group', '{{sudo_group[distro]}}']
has_sudo_nopw: ['mitogen__group', 'mitogen__sudo_nopw']
normal_users: "{{
lookup('sequence', 'start=1 end=5 format=user%d', wantlist=True)
@ -53,14 +57,14 @@
- user:
name: "mitogen__{{item}}"
shell: /bin/bash
groups: "{{groups[item]|default(['mitogen__group'])}}"
groups: "{{user_groups[item]|default(['mitogen__group'])}}"
password: "{{ (item + '_password') | password_hash('sha256') }}"
loop: "{{all_users}}"
when: ansible_system != 'Darwin'
- user:
name: "mitogen__{{item}}"
shell: /bin/bash
groups: "{{groups[item]|default(['mitogen__group'])}}"
groups: "{{user_groups[item]|default(['mitogen__group'])}}"
password: "{{item}}_password"
loop: "{{all_users}}"
when: ansible_system == 'Darwin'

@ -23,9 +23,11 @@ def sh(s, *args):
label_by_id = {}
for base_image, label in [('debian:stretch', 'debian'),
('centos:6', 'centos6'),
('centos:7', 'centos7')]:
for base_image, label in [
('debian:stretch', 'debian'),
('centos:6', 'centos6'),
('centos:7', 'centos7')
]:
args = sh('docker run --rm -it -d -h mitogen-%s %s /bin/bash',
label, base_image)
container_id = subprocess.check_output(args).strip()

Loading…
Cancel
Save