From 40cb84644209206353731e15af24a92b9633ac3e Mon Sep 17 00:00:00 2001 From: wtj Date: Thu, 27 Jul 2023 10:23:46 +0800 Subject: [PATCH] ansible/python: guide Ansible to use requirements.txt --- scripts/ansible/configure.sh | 2 +- scripts/ansible/configure.yaml | 6 +++--- scripts/ansible/python.yaml | 10 ++++++++-- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/scripts/ansible/configure.sh b/scripts/ansible/configure.sh index 64fff0438d..988b0d282d 100644 --- a/scripts/ansible/configure.sh +++ b/scripts/ansible/configure.sh @@ -2,6 +2,7 @@ ansible-playbook tmpfs.yaml -i ansible_hosts ansible-playbook go.yaml -i ansible_hosts ansible-playbook docker.yaml -i ansible_hosts +ansible-playbook acto.yaml -i ansible_hosts ansible-playbook python.yaml -i ansible_hosts ansible-playbook kind.yaml -i ansible_hosts ansible-playbook kubectl.yaml -i ansible_hosts @@ -10,4 +11,3 @@ ansible-playbook sysctl.yaml -i ansible_hosts ansible-playbook k3d.yaml -i ansible_hosts ansible-playbook k9s.yaml -i ansible_hosts ansible-playbook htop.yaml -i ansible_hosts -ansible-playbook acto.yaml -i ansible_hosts diff --git a/scripts/ansible/configure.yaml b/scripts/ansible/configure.yaml index 406c4f8ce6..54b6af7a6d 100644 --- a/scripts/ansible/configure.yaml +++ b/scripts/ansible/configure.yaml @@ -13,6 +13,9 @@ - name: Install docker import_playbook: docker.yaml +- name: Install acto + import_playbook: acto.yaml + - name: Install python import_playbook: python.yaml @@ -36,6 +39,3 @@ - name: Install htop import_playbook: htop.yaml - -- name: Install acto - import_playbook: acto.yaml \ No newline at end of file diff --git a/scripts/ansible/python.yaml b/scripts/ansible/python.yaml index 4d146c1ecb..9353db78fe 100644 --- a/scripts/ansible/python.yaml +++ b/scripts/ansible/python.yaml @@ -12,7 +12,13 @@ state: present update_cache: yes + - name: Get the home directory + become: false + command: echo $HOME + register: home + - name: Install python packages using pip pip: - name: "{{ PYTHON_PKGS }}" - state: present \ No newline at end of file + # Implication: this script should happen after acto.yml + requirements: "{{ home.stdout }}/acto/requirements.txt" + state: present