|
|
@ -3,8 +3,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
from __future__ import print_function
|
|
|
|
from __future__ import print_function
|
|
|
|
|
|
|
|
|
|
|
|
import getpass
|
|
|
|
|
|
|
|
import io
|
|
|
|
|
|
|
|
import os
|
|
|
|
import os
|
|
|
|
import subprocess
|
|
|
|
import subprocess
|
|
|
|
import sys
|
|
|
|
import sys
|
|
|
@ -57,18 +55,6 @@ with ci_lib.Fold('machine_prep'):
|
|
|
|
os.chdir(IMAGE_PREP_DIR)
|
|
|
|
os.chdir(IMAGE_PREP_DIR)
|
|
|
|
ci_lib.run("ansible-playbook -c local -i localhost, _user_accounts.yml")
|
|
|
|
ci_lib.run("ansible-playbook -c local -i localhost, _user_accounts.yml")
|
|
|
|
|
|
|
|
|
|
|
|
# FIXME Don't hardcode https://github.com/mitogen-hq/mitogen/issues/1022
|
|
|
|
|
|
|
|
# and os.environ['USER'] is not populated on Azure macOS runners.
|
|
|
|
|
|
|
|
os.chdir(HOSTS_DIR)
|
|
|
|
|
|
|
|
with io.open('default.hosts', 'r+', encoding='utf-8') as f:
|
|
|
|
|
|
|
|
user = getpass.getuser()
|
|
|
|
|
|
|
|
content = f.read()
|
|
|
|
|
|
|
|
content = content.replace("{{ lookup('pipe', 'whoami') }}", user)
|
|
|
|
|
|
|
|
f.seek(0)
|
|
|
|
|
|
|
|
f.write(content)
|
|
|
|
|
|
|
|
f.truncate()
|
|
|
|
|
|
|
|
ci_lib.dump_file('default.hosts')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cmd = ';'.join([
|
|
|
|
cmd = ';'.join([
|
|
|
|
'from __future__ import print_function',
|
|
|
|
'from __future__ import print_function',
|
|
|
|
'import os, sys',
|
|
|
|
'import os, sys',
|
|
|
|