From 4e946fb7f916db3bf37b27a2510b1ba6e94f1a8b Mon Sep 17 00:00:00 2001 From: Hayato Mizushima Date: Fri, 3 Jan 2025 15:54:25 +0900 Subject: [PATCH 01/15] chore: update dict Signed-off-by: Hayato Mizushima --- .cspell.json | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/.cspell.json b/.cspell.json index ddcc32b..c3d2740 100644 --- a/.cspell.json +++ b/.cspell.json @@ -3,22 +3,31 @@ "amannn", "appdir", "argcomplete", + "armhf", + "autoclean", "bierner", "blockinfile", "bpruitt", "ccache", + "cdimage", "charliermarsh", "containerd", + "cuda", "customizer", "cyclonedds", "danielrichter", "dconf", + "dearmour", + "dearmour", "dotenvx", + "dpkg", "exfatprogs", "fcitx", "fdisk", "flameshot", + "fontconfig", "gparted", + "gpasswd", "hardinfo", "hwclock", "insertafter", @@ -28,7 +37,9 @@ "keymap", "keyrings", "kolourpaint", + "libcudnn", "libfuse", + "libnv", "libxcb", "lichtblick", "lineinfile", @@ -37,24 +48,30 @@ "mozc", "ncdu", "nemo", + "nistp", "nsswitch", "orbstack", + "packagekitd", "pipx", "pytest", "rerunfailures", + "rmem", "rustup", "shellcheck", "shellenv", "shfmt", "SHLVL", + "Sonoma", "sqlitebrowser", + "unhold", "usbubuntu", "usbuntu", "vcstool", "venv", "winbind", + "wslg", "XMODIFIERS", "xset", - "zstd" + "zstd", ] } From e2e3e648dc0d6d948e5d67cdf32e3e743fd60879 Mon Sep 17 00:00:00 2001 From: Hayato Mizushima Date: Fri, 3 Jan 2025 16:38:06 +0900 Subject: [PATCH 02/15] fix: quotation Signed-off-by: Hayato Mizushima --- setup-ubuntu.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup-ubuntu.sh b/setup-ubuntu.sh index 56efd5e..daa5b81 100755 --- a/setup-ubuntu.sh +++ b/setup-ubuntu.sh @@ -16,7 +16,7 @@ fi # export .env set -o allexport # shellcheck disable=SC1091 -source "$(dirname "$0")/.env" +source "$(dirname $0)/.env" set +o allexport ansible-playbook ansible/ubuntu.yml --ask-become-pass From bb954458ce7d50920a0b257153f210bb23f68ee1 Mon Sep 17 00:00:00 2001 From: Hayato Mizushima Date: Fri, 3 Jan 2025 17:30:39 +0900 Subject: [PATCH 03/15] feat: split setup and playbook script (#34) * feat: split script Signed-off-by: Hayato Mizushima * chore: add path Signed-off-by: Hayato Mizushima * chore: update template Signed-off-by: Hayato Mizushima * fix: last comma Signed-off-by: Hayato Mizushima --------- Signed-off-by: Hayato Mizushima --- .cspell.json | 2 +- .github/PULL_REQUEST_TEMPLATE.md | 2 -- ansible-play.sh | 11 +++++++++++ setup-mac.sh | 3 --- setup-ubuntu.sh | 8 -------- 5 files changed, 12 insertions(+), 14 deletions(-) create mode 100755 ansible-play.sh diff --git a/.cspell.json b/.cspell.json index c3d2740..3db433d 100644 --- a/.cspell.json +++ b/.cspell.json @@ -72,6 +72,6 @@ "wslg", "XMODIFIERS", "xset", - "zstd", + "zstd" ] } diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 72a2d2e..a47fee4 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -8,6 +8,4 @@ ## How to review this PR -All required checks by github actions have been passed. - ## Others diff --git a/ansible-play.sh b/ansible-play.sh new file mode 100755 index 0000000..d7e826a --- /dev/null +++ b/ansible-play.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +export PATH="$HOME/.local/bin" + +# export .env +set -o allexport +# shellcheck disable=SC1091 +source "$(dirname "$0")/.env" +set +o allexport + +ansible-playbook ansible/ubuntu.yml --ask-become-pass diff --git a/setup-mac.sh b/setup-mac.sh index 0c66bbc..6c49e4f 100755 --- a/setup-mac.sh +++ b/setup-mac.sh @@ -12,6 +12,3 @@ if ! (command -v ansible-playbook >/dev/null 2>&1); then uv tool install ansible-core ansible-galaxy collection install community.general fi - -ENV_JSON=env.json -ansible-playbook ansible/ubuntu.yml --ask-become-pass -e @${ENV_JSON} diff --git a/setup-ubuntu.sh b/setup-ubuntu.sh index daa5b81..110dbf3 100755 --- a/setup-ubuntu.sh +++ b/setup-ubuntu.sh @@ -12,11 +12,3 @@ if ! (command -v ansible-playbook >/dev/null 2>&1); then uv tool install ansible-core ansible-galaxy collection install community.general fi - -# export .env -set -o allexport -# shellcheck disable=SC1091 -source "$(dirname $0)/.env" -set +o allexport - -ansible-playbook ansible/ubuntu.yml --ask-become-pass From f66ee9d6bf6f7cb4299f6e05e9aa3fc34694680e Mon Sep 17 00:00:00 2001 From: Hayato Mizushima Date: Fri, 3 Jan 2025 18:45:47 +0900 Subject: [PATCH 04/15] fix: dconf (#36) * revert: dconf Signed-off-by: Hayato Mizushima * fix: delete export path Signed-off-by: Hayato Mizushima * fix: dictionary Signed-off-by: Hayato Mizushima * fix: add ignore Signed-off-by: Hayato Mizushima --------- Signed-off-by: Hayato Mizushima --- .cspell.json | 4 ++++ ansible-play.sh | 2 -- ansible/roles/desktop/tasks/main.yml | 22 ++++++++-------------- 3 files changed, 12 insertions(+), 16 deletions(-) diff --git a/.cspell.json b/.cspell.json index 3db433d..85c9327 100644 --- a/.cspell.json +++ b/.cspell.json @@ -5,11 +5,14 @@ "argcomplete", "armhf", "autoclean", + "BFFD", "bierner", "blockinfile", "bpruitt", "ccache", "cdimage", + "CEFE", + "CFEC", "charliermarsh", "containerd", "cuda", @@ -19,6 +22,7 @@ "dconf", "dearmour", "dearmour", + "DONT", "dotenvx", "dpkg", "exfatprogs", diff --git a/ansible-play.sh b/ansible-play.sh index d7e826a..7188378 100755 --- a/ansible-play.sh +++ b/ansible-play.sh @@ -1,7 +1,5 @@ #!/bin/bash -export PATH="$HOME/.local/bin" - # export .env set -o allexport # shellcheck disable=SC1091 diff --git a/ansible/roles/desktop/tasks/main.yml b/ansible/roles/desktop/tasks/main.yml index caefc27..f6fbbd1 100644 --- a/ansible/roles/desktop/tasks/main.yml +++ b/ansible/roles/desktop/tasks/main.yml @@ -28,32 +28,26 @@ - name: set cinnamon env default terminal community.general.dconf: - key: /org/cinnamon/desktop/applications/terminal/exec - value: terminator + key: "/org/cinnamon/desktop/applications/terminal/exec" # yamllint disable-line rule:quoted-strings + value: "'terminator'" # yamllint disable-line rule:quoted-strings state: present - name: set cinnamon env key customize (1/2) community.general.dconf: - key: /org/cinnamon/desktop/wm/preferences/mouse-button-modifier - value: + key: "/org/cinnamon/desktop/wm/preferences/mouse-button-modifier" # yamllint disable-line rule:quoted-strings + value: "''" # yamllint disable-line rule:quoted-strings state: present - name: set cinnamon env key customize (2/2) community.general.dconf: - key: /org/cinnamon/desktop/wm/preferences/mouse-button-zoom-modifier - value: + key: "/org/cinnamon/desktop/wm/preferences/mouse-button-zoom-modifier" # yamllint disable-line rule:quoted-strings + value: "''" # yamllint disable-line rule:quoted-strings state: present - name: set start menu favorite community.general.dconf: - key: /org/cinnamon/favorite-apps - value: - [ - firefox.desktop, - cinnamon-settings.desktop, - nemo.desktop, - terminator.desktop, - ] + key: "/org/cinnamon/favorite-apps" # yamllint disable-line rule:quoted-strings + value: "['firefox.desktop', 'cinnamon-settings.desktop', 'nemo.desktop', 'terminator.desktop']" # yamllint disable-line rule:quoted-strings state: present - name: disable sleep when close note pc display From 7745b757c42730c9b77f567c263abb081b01bb27 Mon Sep 17 00:00:00 2001 From: Hayato Mizushima Date: Fri, 3 Jan 2025 20:37:17 +0900 Subject: [PATCH 05/15] fix: read (#37) * fix: read Signed-off-by: Hayato Mizushima * chore: update Signed-off-by: Hayato Mizushima --------- Signed-off-by: Hayato Mizushima --- post_setup.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/post_setup.sh b/post_setup.sh index d39324b..b94782b 100755 --- a/post_setup.sh +++ b/post_setup.sh @@ -7,13 +7,13 @@ else echo "$HOME/.ssh/github_rsa not found" fi -read -p -r "Do you want install python cli tools using uv? (y/n): " answer +echo "Do you want install python cli tools using uv? (y/n)" +read -r answer if [ "$answer" == "y" ]; then uv tool install pre-commit uv tool install argcomplete uv tool install vcstool - uv tool install ruff else echo "cancel" fi From b61864cdb8e1823a8e02561bc53e1570f9223688 Mon Sep 17 00:00:00 2001 From: Hayato Mizushima Date: Sun, 5 Jan 2025 17:30:42 +0900 Subject: [PATCH 06/15] feat: merge setup script (#38) * feat: merge setup script Signed-off-by: Hayato Mizushima * fix: shell script indent size Signed-off-by: Hayato Mizushima --------- Signed-off-by: Hayato Mizushima --- .editorconfig | 3 +++ README.md | 2 +- ansible-play.sh | 9 --------- setup-mac.sh | 14 -------------- setup-ubuntu.sh | 14 -------------- setup.sh | 36 ++++++++++++++++++++++++++++++++++++ 6 files changed, 40 insertions(+), 38 deletions(-) delete mode 100755 ansible-play.sh delete mode 100755 setup-mac.sh delete mode 100755 setup-ubuntu.sh create mode 100755 setup.sh diff --git a/.editorconfig b/.editorconfig index 3ed1eed..ac90bd6 100644 --- a/.editorconfig +++ b/.editorconfig @@ -13,3 +13,6 @@ trim_trailing_whitespace = false [*.py] indent_size = 4 + +[*.sh] +indent_size = 4 diff --git a/README.md b/README.md index d5dbdb4..d7500cd 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ sudo apt install usb-creator-gtk 事前にgithub_rsaをコピーしておく ```shell -./setup-localhost.sh +./setup.sh ``` ## known issue for 24.04 diff --git a/ansible-play.sh b/ansible-play.sh deleted file mode 100755 index 7188378..0000000 --- a/ansible-play.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash - -# export .env -set -o allexport -# shellcheck disable=SC1091 -source "$(dirname "$0")/.env" -set +o allexport - -ansible-playbook ansible/ubuntu.yml --ask-become-pass diff --git a/setup-mac.sh b/setup-mac.sh deleted file mode 100755 index 6c49e4f..0000000 --- a/setup-mac.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/zsh - -if ! (command -v brew >/dev/null 2>&1); then - /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" - eval "$(/opt/homebrew/bin/brew shellenv)" -fi -if ! (command -v uv >/dev/null 2>&1); then - curl -LsSf https://astral.sh/uv/install.sh | sh - export PATH="$HOME/.cargo/bin:$PATH" -fi -if ! (command -v ansible-playbook >/dev/null 2>&1); then - uv tool install ansible-core - ansible-galaxy collection install community.general -fi diff --git a/setup-ubuntu.sh b/setup-ubuntu.sh deleted file mode 100755 index 110dbf3..0000000 --- a/setup-ubuntu.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash - -if ! (command -v curl >/dev/null 2>&1); then - sudo apt -y update - sudo apt -y install curl -fi -if ! (command -v uv >/dev/null 2>&1); then - curl -LsSf https://astral.sh/uv/install.sh | sh - export PATH="$HOME/.local/bin" -fi -if ! (command -v ansible-playbook >/dev/null 2>&1); then - uv tool install ansible-core - ansible-galaxy collection install community.general -fi diff --git a/setup.sh b/setup.sh new file mode 100755 index 0000000..262cf6e --- /dev/null +++ b/setup.sh @@ -0,0 +1,36 @@ +#!/bin/bash + +# export .env +set -o allexport +# shellcheck disable=SC1091 +source "$(dirname "$0")/.env" +set +o allexport + +PLAYBOOK="ansible/ubuntu.yml" + +if [[ $OSTYPE == 'darwin'* ]]; then + PLAYBOOK="ansible/mac.yml" + if ! (command -v brew >/dev/null 2>&1); then + /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" + eval "$(/opt/homebrew/bin/brew shellenv)" + fi +elif [[ $OSTYPE == 'linux'* ]]; then + if ! (command -v curl >/dev/null 2>&1); then + sudo apt -y update + sudo apt -y install curl + fi +else + echo "This OS is not supported" + exit 1 +fi + +if ! (command -v uv >/dev/null 2>&1); then + curl -LsSf https://astral.sh/uv/install.sh | sh + export PATH="$HOME/.local/bin" +fi +if ! (command -v ansible-playbook >/dev/null 2>&1); then + uv tool install ansible-core + ansible-galaxy collection install community.general +fi + +ansible-playbook $PLAYBOOK --ask-become-pass From 9c88a4c1f8ab1ab36f91afc76c5b1a258388365e Mon Sep 17 00:00:00 2001 From: Hayato Mizushima Date: Thu, 9 Jan 2025 01:45:40 +0900 Subject: [PATCH 07/15] feat: add ghostty (#39) Signed-off-by: Hayato Mizushima --- .cspell.json | 1 + ansible/roles/mac/tasks/main.yml | 1 + 2 files changed, 2 insertions(+) diff --git a/.cspell.json b/.cspell.json index 85c9327..044da34 100644 --- a/.cspell.json +++ b/.cspell.json @@ -30,6 +30,7 @@ "fdisk", "flameshot", "fontconfig", + "ghostty", "gparted", "gpasswd", "hardinfo", diff --git a/ansible/roles/mac/tasks/main.yml b/ansible/roles/mac/tasks/main.yml index 3726f51..deb32fb 100644 --- a/ansible/roles/mac/tasks/main.yml +++ b/ansible/roles/mac/tasks/main.yml @@ -40,6 +40,7 @@ - podman-desktop - thunderbird - visual-studio-code + - ghostty # - google-chrome - name: install fisher From 2fa84ade4f8cee488dc62646e04f01ea99ad7811 Mon Sep 17 00:00:00 2001 From: Hayato Mizushima Date: Fri, 10 Jan 2025 16:47:09 +0900 Subject: [PATCH 08/15] docs: add notice Signed-off-by: Hayato Mizushima --- README.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/README.md b/README.md index d7500cd..10d98b0 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,29 @@ setup OS using ansible +## notice + +aptに以下のようなwarningがある状態で実行するとprivilege output closed while waiting for password promptというようなよくわからないエラーが出ることがある。 +先にaptの修正をする。 + +```shell +W: https://packages.microsoft.com/repos/vscode/dists/stable/InRelease: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details. +W: http://archive.ubuntulinux.jp/ubuntu/dists/jammy/InRelease: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details. +W: http://archive.ubuntulinux.jp/ubuntu-ja-non-free/dists/jammy/InRelease: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details. +W: ターゲット Packages (main/binary-amd64/Packages) は /etc/apt/sources.list.d/google-chrome.list:3 と /etc/apt/sources.list.d/google-chrome.list:4 で複数回設定されています +W: ターゲット Packages (main/binary-all/Packages) は /etc/apt/sources.list.d/google-chrome.list:3 と /etc/apt/sources.list.d/google-chrome.list:4 で複数回設定されています +W: ターゲット Translations (main/i18n/Translation-ja_JP) は /etc/apt/sources.list.d/google-chrome.list:3 と /etc/apt/sources.list.d/google-chrome.list:4 で複数回設定されています +W: ターゲット Translations (main/i18n/Translation-ja) は /etc/apt/sources.list.d/google-chrome.list:3 と /etc/apt/sources.list.d/google-chrome.list:4 で複数回設定されています +W: ターゲット Translations (main/i18n/Translation-en) は /etc/apt/sources.list.d/google-chrome.list:3 と /etc/apt/sources.list.d/google-chrome.list:4 で複数回設定されています +W: ターゲット DEP-11 (main/dep11/Components-amd64.yml) は /etc/apt/sources.list.d/google-chrome.list:3 と /etc/apt/sources.list.d/google-chrome.list:4 で複数回設定されています +W: ターゲット DEP-11 (main/dep11/Components-all.yml) は /etc/apt/sources.list.d/google-chrome.list:3 と /etc/apt/sources.list.d/google-chrome.list:4 で複数回設定されています +W: ターゲット DEP-11-icons-small (main/dep11/icons-48x48.tar) は /etc/apt/sources.list.d/google-chrome.list:3 と /etc/apt/sources.list.d/google-chrome.list:4 で複数回設定されています +W: ターゲット DEP-11-icons (main/dep11/icons-64x64.tar) は /etc/apt/sources.list.d/google-chrome.list:3 と /etc/apt/sources.list.d/google-chrome.list:4 で複数回設定されています +W: ターゲット DEP-11-icons-hidpi (main/dep11/icons-64x64@2.tar) は /etc/apt/sources.list.d/google-chrome.list:3 と /etc/apt/sources.list.d/google-chrome.list:4 で複数回設定されています +W: ターゲット CNF (main/cnf/Commands-amd64) は /etc/apt/sources.list.d/google-chrome.list:3 と /etc/apt/sources.list.d/google-chrome.list:4 で複数回設定されています +W: ターゲット CNF (main/cnf/Commands-all) は /etc/apt/sources.list.d/google-chrome.list:3 と /etc/apt/sources.list.d/google-chrome.list:4 で複数回設定されています +``` + ## Support OS - Ubuntu 22.04 / 24.04 LTS From e94e08a2178d9670ca06b4d1000375861e3c713b Mon Sep 17 00:00:00 2001 From: Hayato Mizushima Date: Sat, 11 Jan 2025 16:02:56 +0900 Subject: [PATCH 09/15] feat: split items performed by user (#40) * feat: split items Signed-off-by: Hayato Mizushima * feat: add user setup Signed-off-by: Hayato Mizushima * fix: empty playbook Signed-off-by: Hayato Mizushima * fix: root user setup Signed-off-by: Hayato Mizushima * fix: pre-commit Signed-off-by: Hayato Mizushima --------- Signed-off-by: Hayato Mizushima --- ansible/roles/desktop/tasks/cinnamon.yml | 23 ++++++++++++++++++++++ ansible/roles/desktop/tasks/main.yml | 25 +----------------------- ansible/roles/dotfiles/tasks/main.yml | 7 ------- ansible/roles/system/tasks/fish.yml | 4 ++++ ansible/roles/system/tasks/main.yml | 18 +++-------------- ansible/roles/system/tasks/mise.yml | 2 ++ ansible/roles/system/tasks/setting.yml | 2 ++ ansible/roles/user/tasks/main.yml | 4 ++++ ansible/user.yml | 5 +++++ user-setup.sh | 14 +++++++++++++ 10 files changed, 58 insertions(+), 46 deletions(-) create mode 100644 ansible/roles/desktop/tasks/cinnamon.yml create mode 100644 ansible/roles/system/tasks/fish.yml create mode 100644 ansible/roles/system/tasks/mise.yml create mode 100644 ansible/roles/system/tasks/setting.yml create mode 100644 ansible/roles/user/tasks/main.yml create mode 100644 ansible/user.yml create mode 100755 user-setup.sh diff --git a/ansible/roles/desktop/tasks/cinnamon.yml b/ansible/roles/desktop/tasks/cinnamon.yml new file mode 100644 index 0000000..b574d5c --- /dev/null +++ b/ansible/roles/desktop/tasks/cinnamon.yml @@ -0,0 +1,23 @@ +- name: set cinnamon env default terminal + community.general.dconf: + key: "/org/cinnamon/desktop/applications/terminal/exec" # yamllint disable-line rule:quoted-strings + value: "'terminator'" # yamllint disable-line rule:quoted-strings + state: present + +- name: set cinnamon env key customize (1/2) + community.general.dconf: + key: "/org/cinnamon/desktop/wm/preferences/mouse-button-modifier" # yamllint disable-line rule:quoted-strings + value: "''" # yamllint disable-line rule:quoted-strings + state: present + +- name: set cinnamon env key customize (2/2) + community.general.dconf: + key: "/org/cinnamon/desktop/wm/preferences/mouse-button-zoom-modifier" # yamllint disable-line rule:quoted-strings + value: "''" # yamllint disable-line rule:quoted-strings + state: present + +- name: set start menu favorite + community.general.dconf: + key: "/org/cinnamon/favorite-apps" # yamllint disable-line rule:quoted-strings + value: "['firefox.desktop', 'cinnamon-settings.desktop', 'nemo.desktop', 'terminator.desktop']" # yamllint disable-line rule:quoted-strings + state: present diff --git a/ansible/roles/desktop/tasks/main.yml b/ansible/roles/desktop/tasks/main.yml index f6fbbd1..a0a9e98 100644 --- a/ansible/roles/desktop/tasks/main.yml +++ b/ansible/roles/desktop/tasks/main.yml @@ -26,30 +26,6 @@ name: grub-customizer update_cache: true -- name: set cinnamon env default terminal - community.general.dconf: - key: "/org/cinnamon/desktop/applications/terminal/exec" # yamllint disable-line rule:quoted-strings - value: "'terminator'" # yamllint disable-line rule:quoted-strings - state: present - -- name: set cinnamon env key customize (1/2) - community.general.dconf: - key: "/org/cinnamon/desktop/wm/preferences/mouse-button-modifier" # yamllint disable-line rule:quoted-strings - value: "''" # yamllint disable-line rule:quoted-strings - state: present - -- name: set cinnamon env key customize (2/2) - community.general.dconf: - key: "/org/cinnamon/desktop/wm/preferences/mouse-button-zoom-modifier" # yamllint disable-line rule:quoted-strings - value: "''" # yamllint disable-line rule:quoted-strings - state: present - -- name: set start menu favorite - community.general.dconf: - key: "/org/cinnamon/favorite-apps" # yamllint disable-line rule:quoted-strings - value: "['firefox.desktop', 'cinnamon-settings.desktop', 'nemo.desktop', 'terminator.desktop']" # yamllint disable-line rule:quoted-strings - state: present - - name: disable sleep when close note pc display become: true ansible.builtin.lineinfile: @@ -90,3 +66,4 @@ update_cache: true - import_tasks: multimedia.yml +- import_tasks: cinnamon.yml diff --git a/ansible/roles/dotfiles/tasks/main.yml b/ansible/roles/dotfiles/tasks/main.yml index 155db12..dbbbe87 100644 --- a/ansible/roles/dotfiles/tasks/main.yml +++ b/ansible/roles/dotfiles/tasks/main.yml @@ -1,10 +1,3 @@ -- name: install git latest - become: true - ansible.builtin.apt: - name: git - update_cache: true - when: ansible_facts['distribution'] == 'Ubuntu' - - name: clone dotfiles ansible.builtin.git: repo: https://github.com/hayato-m126/dotfiles.git diff --git a/ansible/roles/system/tasks/fish.yml b/ansible/roles/system/tasks/fish.yml new file mode 100644 index 0000000..2fdbad2 --- /dev/null +++ b/ansible/roles/system/tasks/fish.yml @@ -0,0 +1,4 @@ +- name: install fisher + ansible.builtin.shell: curl -sL https://git.io/fisher | source && fisher install jorgebucaran/fisher + args: + executable: /bin/fish diff --git a/ansible/roles/system/tasks/main.yml b/ansible/roles/system/tasks/main.yml index e2e2dca..fc51dbf 100644 --- a/ansible/roles/system/tasks/main.yml +++ b/ansible/roles/system/tasks/main.yml @@ -1,6 +1,3 @@ -- name: use English folder name - ansible.builtin.shell: LANG=C xdg-user-dirs-update --force - - name: install system tools using apt become: true ansible.builtin.apt: @@ -27,15 +24,6 @@ name: fish update_cache: true -- name: install fisher - ansible.builtin.shell: curl -sL https://git.io/fisher | source && fisher install jorgebucaran/fisher - args: - executable: /bin/fish - -- name: fisher update - ansible.builtin.shell: fisher update - args: - executable: /bin/fish - -- name: install mise - ansible.builtin.shell: curl https://mise.jdx.dev/install.sh | sh +- import_tasks: fish.yml +- import_tasks: setting.yml +- import_tasks: mise.yml diff --git a/ansible/roles/system/tasks/mise.yml b/ansible/roles/system/tasks/mise.yml new file mode 100644 index 0000000..3af3323 --- /dev/null +++ b/ansible/roles/system/tasks/mise.yml @@ -0,0 +1,2 @@ +- name: install mise + ansible.builtin.shell: curl https://mise.jdx.dev/install.sh | sh diff --git a/ansible/roles/system/tasks/setting.yml b/ansible/roles/system/tasks/setting.yml new file mode 100644 index 0000000..c50fc17 --- /dev/null +++ b/ansible/roles/system/tasks/setting.yml @@ -0,0 +1,2 @@ +- name: use English folder name + ansible.builtin.shell: LANG=C xdg-user-dirs-update --force diff --git a/ansible/roles/user/tasks/main.yml b/ansible/roles/user/tasks/main.yml new file mode 100644 index 0000000..da0eb0a --- /dev/null +++ b/ansible/roles/user/tasks/main.yml @@ -0,0 +1,4 @@ +- import_tasks: ../../desktop/tasks/cinnamon.yml +- import_tasks: ../../system/tasks/fish.yml +- import_tasks: ../../system/tasks/setting.yml +- import_tasks: ../../system/tasks/mise.yml diff --git a/ansible/user.yml b/ansible/user.yml new file mode 100644 index 0000000..0d32642 --- /dev/null +++ b/ansible/user.yml @@ -0,0 +1,5 @@ +- name: setup normal user + hosts: localhost + connection: local + roles: + - role: user diff --git a/user-setup.sh b/user-setup.sh new file mode 100755 index 0000000..ee2e10c --- /dev/null +++ b/user-setup.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +PLAYBOOK="ansible/user.yml" + +if ! (command -v uv >/dev/null 2>&1); then + curl -LsSf https://astral.sh/uv/install.sh | sh + export PATH="$HOME/.local/bin" +fi +if ! (command -v ansible-playbook >/dev/null 2>&1); then + uv tool install ansible-core + ansible-galaxy collection install community.general +fi + +ansible-playbook $PLAYBOOK --ask-become-pass From a91cae2a608c6bc1f366d70a9b4c03ce084738da Mon Sep 17 00:00:00 2001 From: Hayato Mizushima Date: Sat, 11 Jan 2025 16:10:46 +0900 Subject: [PATCH 10/15] feat: container (#41) Signed-off-by: Hayato Mizushima --- ansible/roles/dev_desktop/tasks/main.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ansible/roles/dev_desktop/tasks/main.yml b/ansible/roles/dev_desktop/tasks/main.yml index d181c63..f636ee8 100644 --- a/ansible/roles/dev_desktop/tasks/main.yml +++ b/ansible/roles/dev_desktop/tasks/main.yml @@ -1,2 +1,5 @@ - import_tasks: vscode.yml -# - import_tasks: docker.yml +- import_tasks: docker.yml + when: ansible_facts['distribution_release'] == 'jammy' +- import_tasks: podman.yml + when: ansible_facts['distribution_release'] == 'noble' From ff66ceaeb4eb659783ad8aff42200d86cdfe5240 Mon Sep 17 00:00:00 2001 From: Hayato Mizushima Date: Sun, 12 Jan 2025 03:21:19 +0900 Subject: [PATCH 11/15] feat: arc (#42) Signed-off-by: Hayato Mizushima --- ansible/roles/mac/tasks/main.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/ansible/roles/mac/tasks/main.yml b/ansible/roles/mac/tasks/main.yml index deb32fb..a972ae4 100644 --- a/ansible/roles/mac/tasks/main.yml +++ b/ansible/roles/mac/tasks/main.yml @@ -41,6 +41,7 @@ - thunderbird - visual-studio-code - ghostty + - arc # - google-chrome - name: install fisher From d944070de7232c1d47c2bf851187b4b616bb5383 Mon Sep 17 00:00:00 2001 From: Hayato Mizushima Date: Tue, 14 Jan 2025 21:14:42 +0900 Subject: [PATCH 12/15] docs: github how to start (#43) * docs: github start Signed-off-by: Hayato Mizushima * fix: pre-commit Signed-off-by: Hayato Mizushima --------- Signed-off-by: Hayato Mizushima --- tips/github.md | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 tips/github.md diff --git a/tips/github.md b/tips/github.md new file mode 100644 index 0000000..91c42bc --- /dev/null +++ b/tips/github.md @@ -0,0 +1,46 @@ +# github + +githubのアカウントを作ってsshでgit pushするまでの手順 + +## process + +### github のウェブページでの操作 + +- github アカウント作成する +  - +- メアドを非公開にする + - +- 2FA設定 + - +- ssh key登録 + - + +### ローカル操作 + +- git configを設定する + - email設定のページで表示されているnoreplyのアドレスを設定する + +```shell +git config --global user.name "name" +git config --global user.email "noreply mail address" +``` + +- ssh key作成 + +```shell +ssh-keygen -t ed25519 -f .ssh/github_ed25519 -C "account mail address" +``` + +- sshのconfig設定 + +```shell +touch .ssh/config +``` + +```config +touch .ssh/config +Host github.com + HostName github.com + IdentityFile ~/.ssh/github_ed25519 + User git +``` From 4443ea36144bfc4ca231a9f99607f38ae19895d4 Mon Sep 17 00:00:00 2001 From: Hayato Mizushima Date: Sat, 18 Jan 2025 00:31:30 +0900 Subject: [PATCH 13/15] feat: discord (#44) Signed-off-by: Hayato Mizushima --- ansible/roles/mac/tasks/main.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/ansible/roles/mac/tasks/main.yml b/ansible/roles/mac/tasks/main.yml index a972ae4..c21ff63 100644 --- a/ansible/roles/mac/tasks/main.yml +++ b/ansible/roles/mac/tasks/main.yml @@ -42,6 +42,7 @@ - visual-studio-code - ghostty - arc + - discord # - google-chrome - name: install fisher From 7e7ce63ad29ad083276f34e9561fb687c765418e Mon Sep 17 00:00:00 2001 From: Hayato Mizushima Date: Sat, 18 Jan 2025 18:29:43 +0900 Subject: [PATCH 14/15] docs: github notice Signed-off-by: Hayato Mizushima --- tips/github.md | 38 ++++++++++++++++++++++++++++++++++++-- 1 file changed, 36 insertions(+), 2 deletions(-) diff --git a/tips/github.md b/tips/github.md index 91c42bc..7167076 100644 --- a/tips/github.md +++ b/tips/github.md @@ -7,7 +7,7 @@ githubのアカウントを作ってsshでgit pushするまでの手順 ### github のウェブページでの操作 - github アカウント作成する -  - + - - メアドを非公開にする - - 2FA設定 @@ -38,9 +38,43 @@ touch .ssh/config ``` ```config -touch .ssh/config Host github.com HostName github.com IdentityFile ~/.ssh/github_ed25519 User git ``` + +## notice + + + +複数のアカウントのsshキーを登録するとき、以下のように設定する。 +このとき、mainの方にしか使われない問題があった。ssh agentに明示的にキー追加をすると治った + +```config +Host github.com + HostName github.com + IdentityFile ~/.ssh/github_ed25519 + User git + +Host gh-sub + HostName github.com + IdentityFile ~/.ssh/github_sub_ed25519 + User git +``` + +```gitconfig_sub +[user] + name = sub account name + email = sub-email@users.noreply.github.com +[url "git@gh-sub:"] + insteadOf = https://github.com/ +``` + +修正方法 + +```shell +ssh-add -D +ssh-add ~/.ssh/github_ed25519 +ssh-add ~/.ssh/github_sub_ed25519 +``` From 0701b25dd885894fd2726719ba90e346ae9b04a8 Mon Sep 17 00:00:00 2001 From: Hayato Mizushima Date: Sat, 18 Jan 2025 19:01:59 +0900 Subject: [PATCH 15/15] docs: update Signed-off-by: Hayato Mizushima --- tips/apt.md | 36 +++++++++++++++++++----------------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/tips/apt.md b/tips/apt.md index 31d6d3c..66b4e6f 100644 --- a/tips/apt.md +++ b/tips/apt.md @@ -145,31 +145,33 @@ pub dsa1024 2005-05-24 [SC] uid [ 不明 ] Ubuntu-ja Archive Automatic Signing Key sub elg2048 2005-05-24 [E] -pub rsa1024 2013-08-21 [SC] - 59FD A1CE 1B84 B3FA D893 66C0 2755 7F05 6DC3 3CA5 -uid [ 不明 ] Launchpad PPA for Fish shell maintainers - pub rsa4096 2024-05-03 [SC] 8842 1E70 3EDC 7AF5 4967 DED4 73C9 FCC9 E2BB 48DA uid [ 不明 ] Launchpad PPA for Fish shell maintainers -/etc/apt/trusted.gpg.d/ubuntu-keyring-2012-cdimage.gpg ------------------------------------------------------- -pub rsa4096 2012-05-11 [SC] - 8439 38DF 228D 22F7 B374 2BC0 D94A A3F0 EFE2 1092 -uid [ 不明 ] Ubuntu CD Image Automatic Signing Key (2012) +pub rsa4096 2024-05-02 [SC] + 7EDB 2B9A EE07 57D7 87DF FC20 14BE BC73 63BD C51E +uid [ 不明 ] Launchpad PPA for Daniel Richter + +pub dsa1024 2007-03-08 [SC] + 4CCA 1EAF 950C EE4A B839 76DC A040 830F 7FAC 5991 +uid [ 不明 ] Google, Inc. Linux Package Signing Key +sub elg2048 2007-03-08 [E] + +pub rsa2048 2015-10-28 [SC] + BC52 8686 B50D 79E3 39D3 721C EB3E 94AD BE12 29CF +uid [ 不明 ] Microsoft (Release signing) + +pub rsa4096 2017-02-22 [SCEA] + 9DC8 5822 9FC7 DD38 854A E2D8 8D81 803C 0EBF CD88 +uid [ 不明 ] Docker Release (CE deb) +sub rsa4096 2017-02-22 [S] -/etc/apt/trusted.gpg.d/ubuntu-keyring-2018-archive.gpg ------------------------------------------------------- -pub rsa4096 2018-09-17 [SC] - F6EC B376 2474 EDA9 D21B 7022 8719 20D1 991B C93C -uid [ 不明 ] Ubuntu Archive Automatic Signing Key (2018) ❯ sudo apt-key export 'CDC1D865' | sudo gpg --dearmour -o /etc/apt/trusted.gpg.d/ubuntu-jp-team.gpg ❯ sudo apt-key export '0C4ECFEC' | sudo gpg --dearmour -o /etc/apt/trusted.gpg.d/ubuntu-ja-archive.gpg -❯ sudo apt-key export '6DC33CA5' | sudo gpg --dearmour -o /etc/apt/trusted.gpg.d/fish-shell-old.gpg -❯ sudo apt-key export 'E2BB48DA' | sudo gpg --dearmour -o /etc/apt/trusted.gpg.d/fish-shell-new.gpg -❯ sudo apt-key export '3F055C03' | sudo gpg --dearmour -o /etc/apt/trusted.gpg.d/grub-customizer.gpg +❯ sudo apt-key export 'E2BB48DA' | sudo gpg --dearmour -o /etc/apt/trusted.gpg.d/fish-shell.gpg +❯ sudo apt-key export '63BDC51E' | sudo gpg --dearmour -o /etc/apt/trusted.gpg.d/grub-customizer.gpg ❯ sudo apt-key export '0EBFCD88' | sudo gpg --dearmour -o /etc/apt/trusted.gpg.d/docker.gpg