Skip to content

Commit 98d8fa5

Browse files
committed
update to use pyenv, for real
1 parent 8fa718c commit 98d8fa5

File tree

3 files changed

+9
-0
lines changed

3 files changed

+9
-0
lines changed

component.yml.tpl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ phases:
4747
%{~ endif ~}
4848
- export PYENV_ROOT="${ansible_pyenv_path}"
4949
- export PATH="$PYENV_ROOT/bin:$PATH"
50+
- eval "$(pyenv init -)"
51+
- pyenv activate ${python_version}
5052
# Install playbook dependencies
5153
- ansible-galaxy role install -f -r requirements.yml || true
5254
- ansible-galaxy collection install -f -r requirements.yml || true

main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ locals {
99
playbook_dir = var.playbook_dir
1010
playbook_file = var.playbook_file
1111
playbook_repo = var.playbook_repo
12+
python_version = var.python_version
1213
repo_host = try(local.repo_parts.host, null)
1314
repo_port = coalesce(local.repo_parts.port, 22)
1415
ssh_key_name = try(data.aws_secretsmanager_secret.ssh_key[0].name, null)

variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,12 @@ EOD
6565
type = string
6666
}
6767

68+
variable "python_version" {
69+
default = "3.12"
70+
description = "Version of python to install via pyenv for use with ansible"
71+
type = string
72+
}
73+
6874
variable "ssh_key_secret_arn" {
6975
default = null
7076
description = "ARN of a secretsmanager secret containing an SSH key (use arn OR name, not both)"

0 commit comments

Comments
 (0)