Skip to content
This repository has been archived by the owner on Mar 2, 2022. It is now read-only.

Make the python preinstall more DRY #93

Merged
merged 1 commit into from Oct 15, 2018
Merged

Make the python preinstall more DRY #93

merged 1 commit into from Oct 15, 2018

Conversation

craigtracey
Copy link
Contributor

Right now we have the same code for installing python in two different
places. Additionally, this code assumes Debian based systems. So, clean
this up so that it only applies to Debian systems, and such that it is
consolidated in pre.yml

Signed-off-by: Craig Tracey craigtracey@gmail.com

Copy link
Contributor

@stevesloka stevesloka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When running I get this error in vagrant up:

TASK [Gathering Facts] *********************************************************
fatal: [xenial]: FAILED! => {"changed": false, "module_stderr": "Shared connection to 127.0.0.1 closed.\r\n", "module_stdout": "/bin/sh: 1: /usr/bin/python: not found\r\n", "msg": "MODULE FAILURE", "rc": 0}
	to retry, 

@stevesloka
Copy link
Contributor

The above error might be my mac with python3, I'm checking into that now.

Copy link
Contributor

@scottslowe scottslowe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These changes failed off the bat when attempting to build an AWS image. Here's the output from Packer:

==> ami-ubuntu: Executing Ansible: ansible-playbook --extra-vars packer_build_name=ami-ubuntu packer_builder_type=amazon-ebs -i /tmp/packer-provisioner-ansible384605225 /home/slowe/Public/Repos/heptio/labs/wardroom/ansible/playbook.yml -e ansible_ssh_private_key_file=/tmp/ansible-key961563506 --extra-vars common_upgrade_base=true kubernetes_version=1.11.3-00 kubernetes_cni_version=0.6.0-00
    ami-ubuntu:
    ami-ubuntu: PLAY [all] *********************************************************************
    ami-ubuntu:
    ami-ubuntu: TASK [install python] **********************************************************
    ami-ubuntu: changed: [default]
    ami-ubuntu:
    ami-ubuntu: PLAY [build image] *************************************************************
    ami-ubuntu:
    ami-ubuntu: TASK [Gathering Facts] *********************************************************
    ami-ubuntu: fatal: [default]: FAILED! => {"changed": false, "module_stderr": "/bin/sh: 1: /usr/bin/python: not found\nConnection to 127.0.0.1 closed.\r\n", "module_stdout": "", "msg": "MODULE FAILURE", "rc": 127}
    ami-ubuntu: 	to retry, use: --limit @/home/slowe/Public/Repos/heptio/labs/wardroom/ansible/playbook.retry
    ami-ubuntu:
    ami-ubuntu: PLAY RECAP *********************************************************************
    ami-ubuntu: default                    : ok=1    changed=1    unreachable=0    failed=1
    ami-ubuntu:

Right now we have the same code for installing python in two different
places. Additionally, this code assumes Debian based systems. So, clean
this up so that it only applies to Debian systems, and such that it is
consolidated in `pre.yml`

Signed-off-by: Craig Tracey <craigtracey@gmail.com>
@craigtracey
Copy link
Contributor Author

Yeah, I borked the logic here. Updated.

Please take a look @stevesloka @scottslowe

@scottslowe
Copy link
Contributor

Tested w/ Ubuntu and CentOS builds on AWS, no issues and resulting images had Python 2 installed and working as expected. LGTM.

@stevesloka stevesloka merged commit b054ab3 into master Oct 15, 2018
@stevesloka stevesloka deleted the python-install branch October 15, 2018 14:12
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants