Last active
March 29, 2018 15:05
-
-
Save apahim/83b7c97b58f5bb97b14365786c96e526 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cmd = ('resize2fs /dev/sda1; ' | |
'{pkg_mgm} install -y python libselinux-python git; ' | |
'{pkg_mgm} update -y nettle; ').format(pkg_mgm=self.pkg_mgm) | |
if self.debug: | |
cmd += ('mkdir -p {dir}; ' | |
'chown avocado:avocado {dir}').format(dir=self.iso_dest) | |
ansible_cmd = ('ansible localhost -i "localhost," --become ' | |
'-m raw -a "{cmd}" --user {user} ' | |
'--ssh-common-args="{ssh_args}"') | |
ansible_cmd = ansible_cmd.format(cmd=cmd, user=self.vm.username, | |
ssh_args=' '.join(ssh_args) ) | |
process.run(ansible_cmd, env=env) | |
if self.debug: | |
cmd = (' ansible localhost -i "localhost," ' | |
' -m copy -a "src=%s/minishift.iso dest=%s/" ' | |
' --user %s --ssh-common-args="%s" ' % | |
(self.iso_src, self.iso_dest, self.vm.username, ' '.join(ssh_args))) | |
process.run(cmd, env=env) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment