From ef85726251c7d06b7910bb5c63193713442a6850 Mon Sep 17 00:00:00 2001 From: cradle8810 Date: Fri, 3 May 2024 04:51:14 +0900 Subject: [PATCH] =?UTF-8?q?macOS=E3=81=A7=E3=81=AFpipx=E3=82=92=E4=BD=BF?= =?UTF-8?q?=E3=81=88=E3=81=A8=E3=81=AE=E3=81=93=E3=81=A8=E3=81=A7=E8=AB=B8?= =?UTF-8?q?=E3=80=85=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit gather_factsが有効にならないと条件分岐できないので有効にした --- console.yml | 5 +++-- inventories/host_vars/macbook.yml | 3 +++ macbook.yml | 2 +- skylark.yml | 2 +- tasks/sns_dl_linux.yml | 10 ++++++++-- 5 files changed, 16 insertions(+), 6 deletions(-) diff --git a/console.yml b/console.yml index ccd1d46..8767c9d 100644 --- a/console.yml +++ b/console.yml @@ -2,7 +2,7 @@ - name: Play for console.hayaworld.local hosts: console remote_user: hayato - gather_facts: false + gather_facts: true become: true vars_files: @@ -74,7 +74,8 @@ - name: Install Pre-builded SNS downloaders ansible.builtin.import_tasks: file: tasks/sns_dl_linux.yml - + tags: + - install - name: Stop Apt-daily ansible.builtin.import_tasks: file: tasks/stop-apt-daily.yml diff --git a/inventories/host_vars/macbook.yml b/inventories/host_vars/macbook.yml index 7c9ef9f..8c7f62c 100644 --- a/inventories/host_vars/macbook.yml +++ b/inventories/host_vars/macbook.yml @@ -4,6 +4,7 @@ brew_taps: - ansible - cmigemo - figlet + - gnu-tar - gnupg - htop - imagemagick @@ -13,8 +14,10 @@ brew_taps: - mas - nkf - p7zip + - pipx - pdftoipe - toilet + - unzip - util-linux - wget - x264 diff --git a/macbook.yml b/macbook.yml index 0e51378..9316ae8 100644 --- a/macbook.yml +++ b/macbook.yml @@ -3,7 +3,7 @@ hosts: macbook connection: local remote_user: hayato - gather_facts: false + gather_facts: true vars_files: - inventories/host_vars/macbook.yml diff --git a/skylark.yml b/skylark.yml index 77dd22f..a459f74 100644 --- a/skylark.yml +++ b/skylark.yml @@ -2,7 +2,7 @@ - name: Play for skylark.hayaworld.local hosts: skylark remote_user: hayato - gather_facts: false + gather_facts: true become: true vars_files: diff --git a/tasks/sns_dl_linux.yml b/tasks/sns_dl_linux.yml index b72ea6b..8d06be4 100644 --- a/tasks/sns_dl_linux.yml +++ b/tasks/sns_dl_linux.yml @@ -19,7 +19,13 @@ remote_src: true mode: "0755" - # https://github.com/instaloader/instaloader -- name: Download instaloader + # https://gihub.com/instaloader/instaloader +- name: Download instaloader (Linux) ansible.builtin.pip: name: instaloader + when: ansible_distribution != 'Darwin' + +- name: Download instaloader (macOS) + community.general.pipx: + name: instaloader + when: ansible_distribution == 'Darwin'