From 198bf132aa44c01fac86bdef084887e44354f989 Mon Sep 17 00:00:00 2001 From: Fernando Schauenburg Date: Thu, 17 Dec 2020 20:11:41 +0100 Subject: [PATCH] ansible: fix python role syntax for consistency --- roles/python/tasks/main.yml | 35 ++++++++++++++++++++++------------- 1 file changed, 22 insertions(+), 13 deletions(-) diff --git a/roles/python/tasks/main.yml b/roles/python/tasks/main.yml index bff08fe..b5b67e0 100644 --- a/roles/python/tasks/main.yml +++ b/roles/python/tasks/main.yml @@ -1,25 +1,34 @@ -- name: Install python3 (Debian) +- name: Install python3 with apt when: ansible_os_family == "Debian" become: yes - apt: name={{ item }} state=latest update_cache=yes - loop: [python3, python3-pip] + apt: + update_cache: yes + state: latest + name: + - python3 + - python3-pip -- name: Install python3 (macOS) + +- name: Install python3 with homebrew when: ansible_os_family == "Darwin" - homebrew: name=python3 state=latest + homebrew: + name: python3 + state: latest + - name: Create the python config and data directories file: - path: "{{ item }}" - state: directory + path: "{{ item }}" + state: directory loop: - - ~/.config/python - - ~/.local/share/python + - ~/.config/python + - ~/.local/share/python # for this history file + - name: Deploy python startup file file: - src: "{{ role_path }}/files/startup.py" - dest: ~/.config/python/startup.py - state: link - force: yes + src: "{{ role_path }}/files/startup.py" + dest: ~/.config/python/startup.py + state: link + force: yes