From 65f523c7e6d1998e64008edfed59f767b009082d Mon Sep 17 00:00:00 2001 From: Hayato Date: Sun, 21 Apr 2024 23:27:58 +0900 Subject: [PATCH 1/5] Set macbook hostname --- inventories/host_vars/macbook.yml | 88 ++++++++++++++++++++++++++++++ inventories/host_vars/networks.yml | 2 + inventories/hosts | 3 + macbook.yml | 20 +++++++ 4 files changed, 113 insertions(+) create mode 100644 inventories/host_vars/macbook.yml create mode 100644 macbook.yml diff --git a/inventories/host_vars/macbook.yml b/inventories/host_vars/macbook.yml new file mode 100644 index 0000000..d74a5ef --- /dev/null +++ b/inventories/host_vars/macbook.yml @@ -0,0 +1,88 @@ +--- + +brew_taps: + - ansible + - cmigemo + - figlet + - htop + - imagemagick + - libaacs + - libde265 + - libheif + - nkf + - p7zip + - pdftoipe + - toilet + - wget + - x264 + - x265 + - yt-dlp + - zsh + +symlinks_user: + - src: /Volumes/RAMDisk + dest: ~/Downloads + owner: hayato + group: staff + - src: /Volumes/RAMDisk + dest: ~/RAMDisk + owner: hayato + group: staff + - src: "/Volumes/RAMDisk/.logs/" + dest: "~/Library/Logs" + owner: hayato + group: staff + - src: "/Volumes/RAMDisk/.Saved Application State" + dest: "~/Library/Saved Application State" + owner: hayato + group: staff + - src: "/Volumes/RAMDisk/.cache/com.overmacs.photosweeperpaddle/" + dest: "~/Library/Application Support/com.overmacs.photosweeperpaddle" + owner: hayato + group: staff + - src: "/Volumes/RAMDisk" + dest: "~/Library/Application Support/iMazing/Library/Apps" + owner: hayato + group: staff + - src: "/Volumes/RAMDisk/.cache/Chrome/Sync Data/" + dest: "~/Library/Application Support/Google/Chrome/Default/Sync Data" + owner: hayato + group: staff + - src: "/Volumes/RAMDisk/.cache/com.overmacs.photosweeperpaddle/" + dest: "~/Library/Application Support/PhotoSweeper X" + owner: hayato + group: staff + - src: "/Volumes/RAMDisk/.Saved Application State" + dest: "~/Library/Saved Application State" + owner: hayato + group: staff + - src: "/Volumes/RAMDisk/.logs/" + dest: "~/Library/Logs" + owner: hayato + group: staff + - src: "/Volumes/RAMDisk/.cache/QuickLook" + dest: "~/Library/Caches/QuickLook32" + owner: hayato + group: staff + - src: "/Volumes/RAMDisk/.cache/com.overmacs.photosweeperpaddle" + dest: "~/Library/Caches/com.overmacs.photosweeperpaddle" + owner: hayato + group: staff + - src: "/Volumes/RAMDisk/.cache/QuickLook" + dest: "~/Library/Caches/QuickLook" + owner: hayato + group: staff + - src: "/Volumes/RAMDisk/.cache/Chrome/" + dest: "~/Library/Caches/Google/Chrome" + owner: hayato + group: staff + - src: "/Volumes/RAMDisk/.cache/Homebrew/" + dest: "~/Library/Caches/Homebrew/downloads" + owner: hayato + group: staff + +symlinks_system: + - src: /Volumes/RAMDisk/.logs + dest: /private/var/logs + owner: root + group: wheel \ No newline at end of file diff --git a/inventories/host_vars/networks.yml b/inventories/host_vars/networks.yml index 34967bc..a775fd2 100644 --- a/inventories/host_vars/networks.yml +++ b/inventories/host_vars/networks.yml @@ -32,6 +32,8 @@ network: hostname: skylark.hayaworld.local interface: ens160 ipv4: 192.168.1.200 + macbook: + hostname: HayabookAir2023.hayaworld.local subnet: 24 gw4: 192.168.1.1 dns4: diff --git a/inventories/hosts b/inventories/hosts index ad3bb92..6a8becc 100644 --- a/inventories/hosts +++ b/inventories/hosts @@ -18,3 +18,6 @@ [skylark] 192.168.1.200 ansible_user=hayato + +[macbook] +HayabookAir2023.hayaworld.local ansible_user=hayato diff --git a/macbook.yml b/macbook.yml new file mode 100644 index 0000000..4894894 --- /dev/null +++ b/macbook.yml @@ -0,0 +1,20 @@ +--- +- hosts: macbook + connection: local + remote_user: hayato + gather_facts: false + + vars_files: + - inventories/host_vars/macbook.yml + - inventories/host_vars/networks.yml + + handlers: + - include: handlers/main.yml + + tasks: + - name: Set Hostname + ansible.builtin.hostname: + name: "{{ network.macbook.hostname }}" + become: true + tags: + - network From b28c1df145bf41aef2585b8b2a431b2adfa08d25 Mon Sep 17 00:00:00 2001 From: Hayato Date: Sun, 21 Apr 2024 23:29:21 +0900 Subject: [PATCH 2/5] Add brew for macbook --- inventories/host_vars/macbook.yml | 68 ------------------------------- macbook.yml | 2 + tasks/macbook/brew.yml | 6 +++ 3 files changed, 8 insertions(+), 68 deletions(-) create mode 100644 tasks/macbook/brew.yml diff --git a/inventories/host_vars/macbook.yml b/inventories/host_vars/macbook.yml index d74a5ef..f067f59 100644 --- a/inventories/host_vars/macbook.yml +++ b/inventories/host_vars/macbook.yml @@ -18,71 +18,3 @@ brew_taps: - x265 - yt-dlp - zsh - -symlinks_user: - - src: /Volumes/RAMDisk - dest: ~/Downloads - owner: hayato - group: staff - - src: /Volumes/RAMDisk - dest: ~/RAMDisk - owner: hayato - group: staff - - src: "/Volumes/RAMDisk/.logs/" - dest: "~/Library/Logs" - owner: hayato - group: staff - - src: "/Volumes/RAMDisk/.Saved Application State" - dest: "~/Library/Saved Application State" - owner: hayato - group: staff - - src: "/Volumes/RAMDisk/.cache/com.overmacs.photosweeperpaddle/" - dest: "~/Library/Application Support/com.overmacs.photosweeperpaddle" - owner: hayato - group: staff - - src: "/Volumes/RAMDisk" - dest: "~/Library/Application Support/iMazing/Library/Apps" - owner: hayato - group: staff - - src: "/Volumes/RAMDisk/.cache/Chrome/Sync Data/" - dest: "~/Library/Application Support/Google/Chrome/Default/Sync Data" - owner: hayato - group: staff - - src: "/Volumes/RAMDisk/.cache/com.overmacs.photosweeperpaddle/" - dest: "~/Library/Application Support/PhotoSweeper X" - owner: hayato - group: staff - - src: "/Volumes/RAMDisk/.Saved Application State" - dest: "~/Library/Saved Application State" - owner: hayato - group: staff - - src: "/Volumes/RAMDisk/.logs/" - dest: "~/Library/Logs" - owner: hayato - group: staff - - src: "/Volumes/RAMDisk/.cache/QuickLook" - dest: "~/Library/Caches/QuickLook32" - owner: hayato - group: staff - - src: "/Volumes/RAMDisk/.cache/com.overmacs.photosweeperpaddle" - dest: "~/Library/Caches/com.overmacs.photosweeperpaddle" - owner: hayato - group: staff - - src: "/Volumes/RAMDisk/.cache/QuickLook" - dest: "~/Library/Caches/QuickLook" - owner: hayato - group: staff - - src: "/Volumes/RAMDisk/.cache/Chrome/" - dest: "~/Library/Caches/Google/Chrome" - owner: hayato - group: staff - - src: "/Volumes/RAMDisk/.cache/Homebrew/" - dest: "~/Library/Caches/Homebrew/downloads" - owner: hayato - group: staff - -symlinks_system: - - src: /Volumes/RAMDisk/.logs - dest: /private/var/logs - owner: root - group: wheel \ No newline at end of file diff --git a/macbook.yml b/macbook.yml index 4894894..34170df 100644 --- a/macbook.yml +++ b/macbook.yml @@ -18,3 +18,5 @@ become: true tags: - network + + - import_tasks: tasks/macbook/brew.yml diff --git a/tasks/macbook/brew.yml b/tasks/macbook/brew.yml new file mode 100644 index 0000000..e68a708 --- /dev/null +++ b/tasks/macbook/brew.yml @@ -0,0 +1,6 @@ +--- +- name: Install Macbook brew taps + ansible.builtin.homebrew: + name: "{{ item }}" + state: present + with_items: "{{ brew_taps }}" From 934ba2ba2bc63ab1f52b821fd63f7472fcdf559d Mon Sep 17 00:00:00 2001 From: Hayato Date: Sun, 21 Apr 2024 23:48:24 +0900 Subject: [PATCH 3/5] Add make symlinks for macbook --- inventories/host_vars/macbook.yml | 88 +++++++++++++++++++++++++++++++ macbook.yml | 1 + tasks/macbook/symlinks.yml | 26 +++++++++ 3 files changed, 115 insertions(+) create mode 100644 tasks/macbook/symlinks.yml diff --git a/inventories/host_vars/macbook.yml b/inventories/host_vars/macbook.yml index f067f59..f7903d2 100644 --- a/inventories/host_vars/macbook.yml +++ b/inventories/host_vars/macbook.yml @@ -18,3 +18,91 @@ brew_taps: - x265 - yt-dlp - zsh + +symlinks_user: + - src: /Volumes/RAMDisk + dest: ~/Downloads + owner: hayato + group: staff + - src: /Volumes/RAMDisk + dest: ~/RAMDisk + owner: hayato + group: staff + - src: "/Volumes/RAMDisk/.logs/" + dest: "~/Library/Logs" + owner: hayato + group: staff + - src: "/Volumes/RAMDisk/.Saved Application State" + dest: "~/Library/Saved Application State" + owner: hayato + group: staff + - src: "/Volumes/RAMDisk/.cache/com.overmacs.photosweeperpaddle/" + dest: "~/Library/Application Support/com.overmacs.photosweeperpaddle" + owner: hayato + group: staff + - src: "/Volumes/RAMDisk" + dest: "~/Library/Application Support/iMazing/Library/Apps" + owner: hayato + group: staff + - src: "/Volumes/RAMDisk/.cache/Chrome/Sync Data/" + dest: "~/Library/Application Support/Google/Chrome/Default/Sync Data" + owner: hayato + group: staff + - src: "/Volumes/RAMDisk/.cache/com.overmacs.photosweeperpaddle/" + dest: "~/Library/Application Support/PhotoSweeper X" + owner: hayato + group: staff + - src: "/Volumes/RAMDisk/.Saved Application State" + dest: "~/Library/Saved Application State" + owner: hayato + group: staff + - src: "/Volumes/RAMDisk/.logs/" + dest: "~/Library/Logs" + owner: hayato + group: staff + - src: "/Volumes/RAMDisk/.cache/QuickLook" + dest: "~/Library/Caches/QuickLook32" + owner: hayato + group: staff + - src: "/Volumes/RAMDisk/.cache/com.overmacs.photosweeperpaddle" + dest: "~/Library/Caches/com.overmacs.photosweeperpaddle" + owner: hayato + group: staff + - src: "/Volumes/RAMDisk/.cache/QuickLook" + dest: "~/Library/Caches/QuickLook" + owner: hayato + group: staff + - src: "/Volumes/RAMDisk/.cache/Chrome/" + dest: "~/Library/Caches/Google/Chrome" + owner: hayato + group: staff + - src: "/Volumes/RAMDisk/.cache/Homebrew/" + dest: "~/Library/Caches/Homebrew/downloads" + owner: hayato + group: staff + - src: "/Volumes/Home/Symlinks/BookMaker/" + dest: "~/Library/Application Support/Plustek/BookMaker" + owner: hayato + group: staff + - src: "/Volumes/Home/Symlinks/Sessions/" + dest: "~/Library/Application Support/Google/Chrome/Default/Sessions" + owner: hayato + group: staff + - src: "/Volumes/Home/Symlinks/CDAT/" + dest: "~/Documents/.CDAT" + owner: hayato + group: staff + - src: "/Volumes/RAMDisk/.cache/Homebrew/" + dest: "~/Library/Caches/Homebrew/Downloads" + owner: hayato + group: staff + - src: "/Volumes/RAMDisk/.cache/qlmanage/" + dest: "/var/folders/fj/c3srpxpx41q080qnz4s_p1400000gn/C/com.apple.quicklook.ThumbnailsAgent" + owner: hayato + group: staff + +symlinks_system: + - src: /Volumes/RAMDisk/.logs + dest: /private/var/logs + owner: root + group: wheel diff --git a/macbook.yml b/macbook.yml index 34170df..e85391a 100644 --- a/macbook.yml +++ b/macbook.yml @@ -20,3 +20,4 @@ - network - import_tasks: tasks/macbook/brew.yml + - import_tasks: tasks/macbook/symlinks.yml diff --git a/tasks/macbook/symlinks.yml b/tasks/macbook/symlinks.yml new file mode 100644 index 0000000..a380f1f --- /dev/null +++ b/tasks/macbook/symlinks.yml @@ -0,0 +1,26 @@ +--- +- name: Make symlinks for User + ansible.builtin.file: + src: "{{ item['src'] }}" + dest: "{{ item['dest'] }}" + owner: "{{ item['owner'] }}" + group: "{{ item['group'] }}" + state: link + follow: false + loop: "{{ symlinks_user }}" + tags: + - symlink + +- name: Make symlinks for System (BECOME) + ansible.builtin.file: + src: "{{ item['src'] }}" + dest: "{{ item['dest'] }}" + owner: "{{ item['owner'] }}" + group: "{{ item['group'] }}" + state: link + follow: false + loop: "{{ symlinks_system }}" + become: true + tags: + - symlink + \ No newline at end of file From 683c13fd1918b8266a9c607f8e982be682087c57 Mon Sep 17 00:00:00 2001 From: Hayato Date: Mon, 22 Apr 2024 00:01:16 +0900 Subject: [PATCH 4/5] Change 'C' directory path 'C' dir will change when you clean-installed mac --- inventories/host_vars/macbook.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inventories/host_vars/macbook.yml b/inventories/host_vars/macbook.yml index f7903d2..fc9b5b7 100644 --- a/inventories/host_vars/macbook.yml +++ b/inventories/host_vars/macbook.yml @@ -97,7 +97,7 @@ symlinks_user: owner: hayato group: staff - src: "/Volumes/RAMDisk/.cache/qlmanage/" - dest: "/var/folders/fj/c3srpxpx41q080qnz4s_p1400000gn/C/com.apple.quicklook.ThumbnailsAgent" + dest: "$TMPDIR/../C/com.apple.quicklook.ThumbnailsAgent" owner: hayato group: staff From 081bb83354389a4704c5548f4f83b955b3563910 Mon Sep 17 00:00:00 2001 From: Hayato Date: Mon, 22 Apr 2024 00:05:57 +0900 Subject: [PATCH 5/5] Add installment gnupg(GPG) --- inventories/host_vars/macbook.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/inventories/host_vars/macbook.yml b/inventories/host_vars/macbook.yml index fc9b5b7..c09c6e0 100644 --- a/inventories/host_vars/macbook.yml +++ b/inventories/host_vars/macbook.yml @@ -4,6 +4,7 @@ brew_taps: - ansible - cmigemo - figlet + - gnupg - htop - imagemagick - libaacs