Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/update 202405 #16

Merged
merged 2 commits into from
May 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/pre-commit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ jobs:
- name: run pre-commit
uses: pre-commit/[email protected]
- name: run ansible-lint
uses: ansible/ansible-lint@v24.2.2
uses: ansible/ansible-lint@v24.5.0
env:
ANSIBLE_HOME: ./ansible
21 changes: 11 additions & 10 deletions ansible/playbooks/files/homebrew/Brewfile-mac
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
tap "buo/cask-upgrade" # for `brew cu` command
tap "gromgit/fuse" # for sshfs-mac
tap "homebrew/cask-fonts" # for font installation
tap "homebrew/cask-versions" # for beta fomulae
# Automate deployment, configuration, and upgrading
brew "ansible"
# Checks ansible playbooks for practices and behaviour
Expand All @@ -22,6 +21,8 @@ brew "fish"
brew "fop" # for asdf-erlang
# Software library to render fonts
brew "freetype" # for asdf-php
# GNU compiler collection
brew "gfortran" # part of gcc
# Graphics library to dynamically manipulate images
brew "gd" # for asdf-php
# GNU internationalization (i18n) and localization (l10n) library
Expand Down Expand Up @@ -70,6 +71,8 @@ brew "mise"
brew "molecule"
# Fast, highly customisable system info script
brew "neofetch"
# Regular expressions library
brew "oniguruma" # for asdf-php
# Cryptography and SSL/TLS Toolkit
brew "[email protected]" # for asdf-erlang, asdf-php
brew "openssl@3" # for asdf-erlang, asdf-php
Expand Down Expand Up @@ -113,8 +116,6 @@ cask "font-hackgen-nerd"
cask "font-ricty-diminished"
# GIT client
cask "fork"
# GNU compiler collection
cask "gfortran" # part of gcc
# Free and open-source image editor
cask "gimp"
# Web browser
Expand All @@ -128,7 +129,7 @@ cask "google-japanese-ime"
# Tools to protect your files
cask "gpg-suite-no-mail"
# Android USB tethering driver
cask "horndis"
#cask "horndis"
# Vector graphics editor
cask "inkscape"
# Terminal emulator as alternative to Apple's Terminal app
Expand All @@ -137,24 +138,24 @@ cask "iterm2"
cask "licecap"
# File system integration
cask "macfuse"
# Full TeX Live distribution with GUI applications
cask "mactex"
# Full TeX Live distribution without GUI applications
cask "mactex-no-gui"
# Minimal installer for conda
cask "miniconda"
# Open source implementation of Microsoft's .NET Framework
cask "mono-mdk"
#cask "mono-mdk-for-visual-studio" # install with "visual-studio"
# App to write, plan, collaborate, and get organised
cask "notion"
# Command-line shell and scripting language
cask "powershell"
# Flexible software sketchbook and a language for learning how to code
cask "processing"
# All-in-one bookmark manager
cask "raindropio"
# Video chat, voice call and instant messaging application
cask "skype"
# Team communication and collaboration software
cask "slack"
# Video game digital distribution service
cask "steam"
# To-do list
cask "todoist"
# Management tool for Unity
Expand All @@ -168,7 +169,7 @@ cask "wacom-tablet"
# Mind mapping and brainstorming tool
cask "xmind"
mas "Kindle", id: 302584613
mas "LimeChat", id: 414030210
#mas "LimeChat", id: 414030210
mas "LINE", id: 539883307
mas "Microsoft Excel", id: 462058435
mas "Microsoft Remote Desktop", id: 1295203466
Expand Down
6 changes: 3 additions & 3 deletions ansible/playbooks/handlers/handlers_macos.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
---
- name: Restart Dock
listen: restart_dock
listen: RestartDock
ansible.builtin.command: killall 'Dock'
changed_when: true

- name: Restart Finder
listen: restart_finder
listen: RestartFinder
ansible.builtin.command: killall 'Finder'
changed_when: true

- name: Update global path
listen: update_global_path
listen: UpdateGlobalPath
# import_tasksにすると通知を受け取れなくなる
ansible.builtin.include_tasks: includes/set_global_path.yaml
2 changes: 1 addition & 1 deletion ansible/playbooks/handlers/handlers_wsl.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
# update global path
- name: Update global path
listen: update_global_path
listen: UpdateGlobalPath
ansible.builtin.debug:
msg: I have nothing to do.
12 changes: 6 additions & 6 deletions ansible/roles/fish/tasks/includes/change_login_shell_macos.yaml
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
---
- name: change_login_shell_macos | Check user's login shell (for macOSX)
- name: includes | change_login_shell_macos | Check user's login shell (for macOSX)

Check warning on line 2 in ansible/roles/fish/tasks/includes/change_login_shell_macos.yaml

View workflow job for this annotation

GitHub Actions / pre-commit

risky-shell-pipe

Shells that use pipes should set the pipefail option.

Check warning on line 2 in ansible/roles/fish/tasks/includes/change_login_shell_macos.yaml

View workflow job for this annotation

GitHub Actions / pre-commit

risky-shell-pipe

Shells that use pipes should set the pipefail option.
ansible.builtin.shell: dscl . -read '/Users/{{ user }}' UserShell | grep -q '{{ fish_path }}'
register: check_fish_is_login_shell
failed_when: check_fish_is_login_shell.rc not in [0, 1]
changed_when: false
check_mode: false

- name: change_login_shell_macos | Change login shell to fish
- name: includes | change_login_shell_macos | Change login shell to fish
when: check_fish_is_login_shell.rc != 0
block:
- name: change_login_shell_macos | Find expect
- name: includes | change_login_shell_macos | Find expect
ansible.builtin.command: which expect
register: which_expect
changed_when: false

- name: change_login_shell_macos | Change login shell to fish
- name: includes | change_login_shell_macos | Change login shell to fish
become: true
ansible.builtin.script: common/chsh.exp "{{ fish_path }}" "{{ my_password }}" "{{ user }}"
args:
executable: '{{ which_expect.stdout }}'

- name: change_login_shell_macos | Read current UserShell
- name: includes | change_login_shell_macos | Read current UserShell
ansible.builtin.command: dscl . -read '/Users/{{ user }}' UserShell
register: recheck_fish_is_login_shell
changed_when: false
check_mode: false

- name: change_login_shell_macos | Recheck user's login shell
- name: includes | change_login_shell_macos | Recheck user's login shell

Check warning on line 29 in ansible/roles/fish/tasks/includes/change_login_shell_macos.yaml

View workflow job for this annotation

GitHub Actions / pre-commit

risky-shell-pipe

Shells that use pipes should set the pipefail option.

Check warning on line 29 in ansible/roles/fish/tasks/includes/change_login_shell_macos.yaml

View workflow job for this annotation

GitHub Actions / pre-commit

risky-shell-pipe

Shells that use pipes should set the pipefail option.
ansible.builtin.shell: >-
echo {{ recheck_fish_is_login_shell.stdout }}
| grep -q '{{ fish_path }}'
Expand Down
12 changes: 6 additions & 6 deletions ansible/roles/fish/tasks/includes/change_login_shell_other.yaml
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
---
- name: change_login_shell_other | Check user's login shell (for other)
- name: includes | change_login_shell_other | Check user's login shell (for other)

Check warning on line 2 in ansible/roles/fish/tasks/includes/change_login_shell_other.yaml

View workflow job for this annotation

GitHub Actions / pre-commit

risky-shell-pipe

Shells that use pipes should set the pipefail option.

Check warning on line 2 in ansible/roles/fish/tasks/includes/change_login_shell_other.yaml

View workflow job for this annotation

GitHub Actions / pre-commit

risky-shell-pipe

Shells that use pipes should set the pipefail option.
ansible.builtin.shell: cat /etc/passwd | grep -q '{{ home }}:{{ fish_path }}'
register: check_fish_is_login_shell
failed_when: check_fish_is_login_shell.rc not in [0, 1]
changed_when: false
check_mode: false

- name: change_login_shell_other | Change login shell to fish
- name: includes | change_login_shell_other | Change login shell to fish
when: check_fish_is_login_shell.rc != 0
block:
- name: change_login_shell_other | Find expect
- name: includes | change_login_shell_other | Find expect
ansible.builtin.command: which expect
register: which_expect
changed_when: false

- name: change_login_shell_other | Change login shell to fish
- name: includes | change_login_shell_other | Change login shell to fish
become: true
ansible.builtin.script: common/chsh.exp "{{ fish_path }}" "{{ my_password }}" "{{ user }}"
args:
executable: '{{ which_expect.stdout }}'

- name: change_login_shell_other | Read current usershell
- name: includes | change_login_shell_other | Read current usershell

Check warning on line 23 in ansible/roles/fish/tasks/includes/change_login_shell_other.yaml

View workflow job for this annotation

GitHub Actions / pre-commit

risky-shell-pipe

Shells that use pipes should set the pipefail option.

Check warning on line 23 in ansible/roles/fish/tasks/includes/change_login_shell_other.yaml

View workflow job for this annotation

GitHub Actions / pre-commit

risky-shell-pipe

Shells that use pipes should set the pipefail option.
ansible.builtin.shell: cat /etc/passwd | grep -e '^{{ user }}:'
register: recheck_fish_is_login_shell
changed_when: false
check_mode: false

- name: change_login_shell_other | Recheck user's login shell
- name: includes | change_login_shell_other | Recheck user's login shell

Check warning on line 29 in ansible/roles/fish/tasks/includes/change_login_shell_other.yaml

View workflow job for this annotation

GitHub Actions / pre-commit

risky-shell-pipe

Shells that use pipes should set the pipefail option.

Check warning on line 29 in ansible/roles/fish/tasks/includes/change_login_shell_other.yaml

View workflow job for this annotation

GitHub Actions / pre-commit

risky-shell-pipe

Shells that use pipes should set the pipefail option.
ansible.builtin.shell: >-
echo {{ recheck_fish_is_login_shell.stdout }}
| grep -q '{{ home }}:{{ fish_path }}'
Expand Down
6 changes: 3 additions & 3 deletions ansible/roles/fish/tasks/includes/set_brew_prefix.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
---
- name: set_brew_prefix | Check Homebrew/Linuxbrew
- name: includes | set_brew_prefix | Check Homebrew/Linuxbrew
ansible.builtin.command: which brew
changed_when: false
check_mode: false

- name: set_brew_prefix | Get brew --prefix
- name: includes | set_brew_prefix | Get brew --prefix
ansible.builtin.command: brew --prefix
register: get_brew_prefix
changed_when: false
check_mode: false

- name: set_brew_prefix | Set Homebrew/Linuxbrew prefix
- name: includes | set_brew_prefix | Set Homebrew/Linuxbrew prefix
ansible.builtin.set_fact:
brew_prefix: '{{ get_brew_prefix.stdout }}'
8 changes: 4 additions & 4 deletions ansible/roles/fish/tasks/includes/set_env_macos.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
- name: set_env_macos | Set environment variables (for MacOSX)
- name: includes | set_env_macos | Set environment variables (for MacOSX)
ansible.builtin.shell: >-
set -Ux ANDROID_HOME {{ home }}/Library/Android/sdk;
set -Ux ANDRIOD_SDK_ROOT {{ home }}/Library/Android/sdk;
Expand All @@ -8,18 +8,18 @@
executable: '{{ fish_path }}'
changed_when: false

- name: set_env_macos | Add tools to fish_user_paths (for MacOSX)
- name: includes | set_env_macos | Add tools to fish_user_paths (for MacOSX)
ansible.builtin.shell: set -U fish_user_paths $fish_user_paths "{{ item }}"
args:
executable: '{{ fish_path }}'
when: fish_user_paths is not search(item)
changed_when: true
notify: update_global_path
notify: UpdateGlobalPath
loop:
- '{{ home }}/Library/Android/sdk/tools'
- '{{ home }}/Library/Android/sdk/platform-tools'

- name: set_env_macos | Make PKG_CONFIG_PATH config (for MacOSX)
- name: includes | set_env_macos | Make PKG_CONFIG_PATH config (for MacOSX)
ansible.builtin.copy:
dest: '{{ xdg_config_home }}/fish/conf.d/{{ item }}.fish'
content: >
Expand Down
30 changes: 15 additions & 15 deletions ansible/roles/fish/tasks/includes/set_env_other.yaml
Original file line number Diff line number Diff line change
@@ -1,58 +1,58 @@
---
- name: set_env_other | Set_fact
- name: includes | set_env_other | Set_fact
block:
- name: set_env_other | Get brew prefix
- name: includes | set_env_other | Get brew prefix
ansible.builtin.import_tasks: includes/set_brew_prefix.yaml

- name: set_env_other | Echo LIBRARY_PATH (for other)
- name: includes | set_env_other | Echo LIBRARY_PATH (for other)
ansible.builtin.shell: echo $LIBRARY_PATH
args:
executable: '{{ fish_path }}'
register: echo_lib_path
changed_when: false
check_mode: false

- name: set_env_other | Echo LD_LIBRARY_PATH (for other)
- name: includes | set_env_other | Echo LD_LIBRARY_PATH (for other)
ansible.builtin.shell: echo $LD_LIBRARY_PATH
args:
executable: '{{ fish_path }}'
register: echo_ld_lib_path
changed_when: false
check_mode: false

- name: set_env_other | Echo C_INCLUDE_PATH (for other)
- name: includes | set_env_other | Echo C_INCLUDE_PATH (for other)
ansible.builtin.shell: echo $C_INCLUDE_PATH
args:
executable: '{{ fish_path }}'
register: echo_c_include_path
changed_when: false
check_mode: false

- name: set_env_other | Echo CPLUS_INCLUDE_PATH (for other)
- name: includes | set_env_other | Echo CPLUS_INCLUDE_PATH (for other)
ansible.builtin.shell: echo $CPLUS_INCLUDE_PATH
args:
executable: '{{ fish_path }}'
register: echo_cplus_include_path
changed_when: false
check_mode: false

- name: set_env_other | Echo OBJC_INCLUDE_PATH (for other)
- name: includes | set_env_other | Echo OBJC_INCLUDE_PATH (for other)
ansible.builtin.shell: echo $OBJC_INCLUDE_PATH
args:
executable: '{{ fish_path }}'
register: echo_objc_include_path
changed_when: false
check_mode: false

- name: set_env_other | Set lib_path and include_path (for other)
- name: includes | set_env_other | Set lib_path and include_path (for other)
ansible.builtin.set_fact:
lib_path: '{{ echo_lib_path.stdout }}'
ld_lib_path: '{{ echo_ld_lib_path.stdout }}'
c_include_path: '{{ echo_c_include_path.stdout }}'
cplus_include_path: '{{ echo_cplus_include_path.stdout }}'
objc_include_path: '{{ echo_objc_include_path.stdout }}'

- name: set_env_other | Add Linuxbrew to LIBRARY_PATH (for other)
- name: includes | set_env_other | Add Linuxbrew to LIBRARY_PATH (for other)
ansible.builtin.shell: set -Ux LIBRARY_PATH "{{ item }}" $LIBRARY_PATH
args:
executable: '{{ fish_path }}'
Expand All @@ -62,7 +62,7 @@
- '{{ brew_prefix }}/lib'
- '/usr/lib/x86_64-linux-gnu' # linuxbrewのlibより先に読み込ませる(for curl)

- name: set_env_other | Add Linuxbrew to LD_LIBRARY_PATH (for other)
- name: includes | set_env_other | Add Linuxbrew to LD_LIBRARY_PATH (for other)
ansible.builtin.shell: set -Ux LD_LIBRARY_PATH "{{ item }}" $LD_LIBRARY_PATH
args:
executable: '{{ fish_path }}'
Expand All @@ -72,7 +72,7 @@
- '{{ brew_prefix }}/lib'
- '/usr/lib/x86_64-linux-gnu' # linuxbrewのlibより先に読み込ませる(for curl)

- name: set_env_other | Add Linuxbrew to C_INCLUDE_PATH (for other)
- name: includes | set_env_other | Add Linuxbrew to C_INCLUDE_PATH (for other)
ansible.builtin.shell: set -Ux C_INCLUDE_PATH "{{ item }}" $C_INCLUDE_PATH
args:
executable: '{{ fish_path }}'
Expand All @@ -81,7 +81,7 @@
with_items:
- '{{ brew_prefix }}/include'

- name: set_env_other | Add Linuxbrew to CPLUS_INCLUDE_PATH (for other)
- name: includes | set_env_other | Add Linuxbrew to CPLUS_INCLUDE_PATH (for other)
ansible.builtin.shell: set -Ux CPLUS_INCLUDE_PATH "{{ item }}" $CPLUS_INCLUDE_PATH
args:
executable: '{{ fish_path }}'
Expand All @@ -90,7 +90,7 @@
with_items:
- '{{ brew_prefix }}/include'

- name: set_env_other | Add Linuxbrew to OBJC_INCLUDE_PATH (for other)
- name: includes | set_env_other | Add Linuxbrew to OBJC_INCLUDE_PATH (for other)
ansible.builtin.shell: set -Ux OBJC_INCLUDE_PATH "{{ item }}" $OBJC_INCLUDE_PATH
args:
executable: '{{ fish_path }}'
Expand All @@ -99,7 +99,7 @@
with_items:
- '{{ brew_prefix }}/include'

- name: set_env_other | Make PKG_CONFIG_PATH config (for other)
- name: includes | set_env_other | Make PKG_CONFIG_PATH config (for other)
ansible.builtin.copy:
dest: '{{ xdg_config_home }}/fish/conf.d/{{ item }}.fish'
content: >
Expand All @@ -108,7 +108,7 @@
mode: 0644
with_items: []

- name: set_env_other | Add other PKG_CONFIG_PATH config (for other)
- name: includes | set_env_other | Add other PKG_CONFIG_PATH config (for other)
ansible.builtin.copy:
dest: '{{ xdg_config_home }}/fish/conf.d/{{ item.name }}.fish'
content: >
Expand Down
4 changes: 2 additions & 2 deletions ansible/roles/fish/tasks/includes/set_fish_path.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
---
- name: set_fish_path | Find fish
- name: includes | set_fish_path | Find fish
ansible.builtin.command: which fish
register: which_fish
changed_when: false
check_mode: false

- name: set_fish_path | Set fish_path
- name: includes | set_fish_path | Set fish_path
ansible.builtin.set_fact:
fish_path: '{{ which_fish.stdout }}'
4 changes: 2 additions & 2 deletions ansible/roles/fish/tasks/includes/set_fish_user_paths.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
---
- name: set_fish_user_paths | Check fish_user_paths
- name: includes | set_fish_user_paths | Check fish_user_paths
ansible.builtin.shell: echo $fish_user_paths
args:
executable: '{{ fish_path }}'
register: check_fish_user_paths
changed_when: false
check_mode: false

- name: set_fish_user_paths | Set fish_user_paths
- name: includes | set_fish_user_paths | Set fish_user_paths
ansible.builtin.set_fact:
fish_user_paths: '{{ check_fish_user_paths.stdout }}'
Loading
Loading