Skip to content

Commit

Permalink
Try mac
Browse files Browse the repository at this point in the history
  • Loading branch information
dhvcc committed Feb 12, 2024
1 parent a01d7be commit 4362e18
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 31 deletions.
58 changes: 28 additions & 30 deletions .cfg/playbook-with-mac.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
- name: Install dependencies and configure environment
hosts: localhost
become: yes
gather_facts: false
tasks:
- name: Update apt cache (Ubuntu)
Expand Down Expand Up @@ -82,34 +83,31 @@
name: fd
when: ansible_os_family == 'Darwin'

- name: Create symlink for fd
file:
src: "{{ ansible_playbook_dir }}/.local/bin/fd"
dest: "~/.local/bin/fd"
state: link
# - name: Create symlink for fd
# file:
# src: "{{ ansible_playbook_dir }}/.local/bin/fd"
# dest: "~/.local/bin/fd"
# state: link
#
# - name: Install bat (Ubuntu)
# apt:
# name: bat
# state: present
# when: ansible_os_family == 'Debian'
#
# - name: Install bat (macOS)
# homebrew:
# name: bat
# when: ansible_os_family == 'Darwin'
#
# - name: Create symlink for bat
# file:
# src: "{{ ansible_playbook_dir }}/.local/bin/bat"
# dest: "~/.local/bin/bat"
# state: link

- name: Install bat (Ubuntu)
apt:
name: bat
state: present
when: ansible_os_family == 'Debian'

- name: Install bat (macOS)
homebrew:
name: bat
when: ansible_os_family == 'Darwin'

- name: Create symlink for bat
file:
src: "{{ ansible_playbook_dir }}/.local/bin/bat"
dest: "~/.local/bin/bat"
state: link

# Other tasks remain the same as in the previous playbook
# ...

- name: Set default shell
hosts: localhost
tasks:
- name: Set default shell to zsh
shell: chsh -s /bin/zsh "{{ ansible_ssh_user }}"
#- name: Set default shell
# hosts: localhost
# tasks:
# - name: Set default shell to zsh
# shell: chsh -s /bin/zsh "{{ ansible_ssh_user }}"
2 changes: 1 addition & 1 deletion .github/workflows/playbook-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,5 @@ jobs:
- name: Test Ansible Playbook
run: |
sudo ansible-playbook playbook.yaml
sudo ansible-playbook .cfg/playbook-with-mac.yaml

0 comments on commit 4362e18

Please sign in to comment.