From 85e79844b7bdb5a541dd1a1fb566b219d0292e81 Mon Sep 17 00:00:00 2001 From: Tom Alexander Date: Mon, 6 Mar 2023 15:44:33 -0500 Subject: [PATCH] Add pyenv to FreeBSD. --- ansible/roles/pyenv/files/zshrc_pyenv | 3 +++ ansible/roles/pyenv/tasks/common.yaml | 6 ++++++ ansible/roles/pyenv/tasks/linux.yaml | 5 ----- ansible/roles/pyenv/tasks/peruser.yaml | 10 ++++++++++ 4 files changed, 19 insertions(+), 5 deletions(-) create mode 100644 ansible/roles/pyenv/files/zshrc_pyenv diff --git a/ansible/roles/pyenv/files/zshrc_pyenv b/ansible/roles/pyenv/files/zshrc_pyenv new file mode 100644 index 0000000..affc106 --- /dev/null +++ b/ansible/roles/pyenv/files/zshrc_pyenv @@ -0,0 +1,3 @@ +export PYENV_ROOT=$(pyenv root) +command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH" +eval "$(pyenv init -)" diff --git a/ansible/roles/pyenv/tasks/common.yaml b/ansible/roles/pyenv/tasks/common.yaml index fef1101..c10d22d 100644 --- a/ansible/roles/pyenv/tasks/common.yaml +++ b/ansible/roles/pyenv/tasks/common.yaml @@ -1,3 +1,9 @@ +- name: Install packages + package: + name: + - pyenv + state: present + - import_tasks: tasks/freebsd.yaml when: 'os_flavor == "freebsd"' diff --git a/ansible/roles/pyenv/tasks/linux.yaml b/ansible/roles/pyenv/tasks/linux.yaml index 67da96a..e69de29 100644 --- a/ansible/roles/pyenv/tasks/linux.yaml +++ b/ansible/roles/pyenv/tasks/linux.yaml @@ -1,5 +0,0 @@ -- name: Install packages - package: - name: - - pyenv - state: present diff --git a/ansible/roles/pyenv/tasks/peruser.yaml b/ansible/roles/pyenv/tasks/peruser.yaml index 111e886..f3db8de 100644 --- a/ansible/roles/pyenv/tasks/peruser.yaml +++ b/ansible/roles/pyenv/tasks/peruser.yaml @@ -22,6 +22,16 @@ # - src: foo.conf # dest: .config/foo/foo.conf +- name: Configure zshrc additional imports + copy: + src: "files/zshrc_{{ item }}" + dest: "{{ account_homedir.stdout }}/.config/ansible_deploy/zshrc/{{ item }}.zsh" + mode: 0600 + owner: "{{ account_name.stdout }}" + group: "{{ group_name.stdout }}" + loop: + - pyenv + - import_tasks: tasks/peruser_freebsd.yaml when: 'os_flavor == "freebsd"'