-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
375 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,115 @@ | ||
--- | ||
- name: Install dependencies and configure environment | ||
hosts: localhost | ||
gather_facts: false | ||
tasks: | ||
- name: Update apt cache (Ubuntu) | ||
apt: | ||
update_cache: yes | ||
when: ansible_os_family == 'Debian' | ||
|
||
- name: Install essential packages (Ubuntu) | ||
apt: | ||
name: "{{ item }}" | ||
state: present | ||
loop: | ||
- curl | ||
- wget | ||
- git | ||
- gcc | ||
- g++ | ||
- libffi-dev | ||
- htop | ||
- xclip | ||
- make | ||
- vim | ||
- python3-dev | ||
- python3-pip | ||
- python3-venv | ||
- libpq-dev | ||
- libsqlite3-dev | ||
- lzma-dev | ||
- libreadline6-dev | ||
- libbz2-dev | ||
- cargo | ||
- bash | ||
- zsh | ||
- neofetch | ||
- unzip | ||
- ripgrep | ||
when: ansible_os_family == 'Debian' | ||
|
||
- name: Update Homebrew (macOS) | ||
homebrew: | ||
state: latest | ||
when: ansible_os_family == 'Darwin' | ||
|
||
- name: Install essential packages (macOS) | ||
homebrew: | ||
name: "{{ item }}" | ||
loop: | ||
- curl | ||
- wget | ||
- git | ||
- gcc | ||
- libffi | ||
- htop | ||
- xclip | ||
- make | ||
- vim | ||
- python | ||
- postgresql | ||
- sqlite | ||
- xz | ||
- readline | ||
- bzip2 | ||
- cargo | ||
- bash | ||
- zsh | ||
- neofetch | ||
- unzip | ||
- ripgrep | ||
when: ansible_os_family == 'Darwin' | ||
|
||
- name: Install fd-find (Ubuntu) | ||
apt: | ||
name: fd-find | ||
state: present | ||
when: ansible_os_family == 'Debian' | ||
|
||
- name: Install fd-find (macOS) | ||
homebrew: | ||
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: 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 }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
--- | ||
- name: Install dependencies and configure environment | ||
hosts: localhost | ||
gather_facts: false | ||
tasks: | ||
- name: Update apt cache | ||
apt: | ||
update_cache: yes | ||
|
||
- name: Install essential packages | ||
apt: | ||
name: "{{ item }}" | ||
state: present | ||
loop: | ||
- curl | ||
- wget | ||
- git | ||
- gcc | ||
- g++ | ||
- libffi-dev | ||
- htop | ||
- xclip | ||
- make | ||
- vim | ||
- python3-dev | ||
- python3-pip | ||
- python3-venv | ||
- libpq-dev | ||
- libsqlite3-dev | ||
- lzma-dev | ||
- libreadline6-dev | ||
- libbz2-dev | ||
- cargo | ||
- bash | ||
- zsh | ||
- neofetch | ||
- unzip | ||
- ripgrep | ||
|
||
- name: Install additional packages | ||
apt: | ||
name: "{{ item }}" | ||
state: present | ||
loop: | ||
- fd-find | ||
- bat | ||
|
||
- name: Install lsd | ||
apt: | ||
deb: "https://github.com/lsd-rs/lsd/releases/download/v1.0.0/lsd-musl_1.0.0_amd64.deb" | ||
state: present | ||
|
||
- name: Create symlinks for fd and bat | ||
file: | ||
src: "{{ item.src }}" | ||
dest: "{{ item.dest }}" | ||
state: link | ||
loop: | ||
- { src: "{{ ansible_playbook_dir }}/.local/bin/fd", dest: "~/.local/bin/fd" } | ||
- { src: "{{ ansible_playbook_dir }}/.local/bin/bat", dest: "~/.local/bin/bat" } | ||
|
||
- name: Install pyenv | ||
shell: "curl https://pyenv.run | bash" | ||
|
||
- name: Install Node.js using fnm | ||
shell: "curl -fsSL https://fnm.vercel.app/install | bash && /bin/zsh -i -c 'fnm install 16'" | ||
|
||
- name: Install fzf | ||
git: | ||
repo: https://github.com/junegunn/fzf.git | ||
dest: ~/.fzf | ||
version: master | ||
become: yes | ||
|
||
- name: Run fzf install script | ||
command: "~/.fzf/install --all" | ||
|
||
- name: Install Neovim, omb, and oh-my-zsh | ||
shell: "./.cfg/scripts/install-neovim.sh && ./.cfg/scripts/install-omb.sh && ./.cfg/scripts/install-omz.sh" | ||
|
||
- name: Install Starship prompt | ||
shell: "sh -c 'curl -fsSL https://starship.rs/install.sh | bash -s -- -f'" | ||
|
||
- name: Install pipx and packages | ||
pipx: | ||
package: "{{ item }}" | ||
loop: | ||
- ansible | ||
- git+https://github.com/politeauthority/docker-pretty-ps.git#egg=docker-pretty-ps | ||
- ranger-fm | ||
- poetry | ||
- ipython | ||
become: yes | ||
|
||
- name: Copy configuration files | ||
copy: | ||
src: "{{ item }}" | ||
dest: "~" | ||
loop: | ||
- .bashrc | ||
- .zshrc | ||
|
||
- name: Set default shell | ||
hosts: localhost | ||
tasks: | ||
- name: Set default shell to zsh | ||
shell: chsh -s /bin/zsh "{{ ansible_ssh_user }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: Ansible Playbook Test | ||
|
||
on: | ||
push: | ||
branches: | ||
- playbook-wip | ||
|
||
jobs: | ||
test: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, macos-latest] | ||
|
||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.10' | ||
|
||
- name: Install Ansible | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install ansible | ||
- name: Test Ansible Playbook | ||
run: | | ||
ansible-playbook playbook.yml | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
FROM python:3.10 | ||
|
||
WORKDIR /root/configs | ||
|
||
RUN pip install ansible |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,116 @@ | ||
--- | ||
- name: Install dependencies and configure environment | ||
hosts: localhost | ||
gather_facts: true | ||
tasks: | ||
- name: Update apt cache (Ubuntu) | ||
apt: | ||
update_cache: yes | ||
when: ansible_os_family == 'Debian' | ||
|
||
- name: Install essential packages (Ubuntu) | ||
apt: | ||
name: "{{ item }}" | ||
state: present | ||
loop: | ||
- curl | ||
- wget | ||
- git | ||
- gcc | ||
- g++ | ||
- libffi-dev | ||
- htop | ||
- xclip | ||
- make | ||
- vim | ||
- python3-dev | ||
- python3-pip | ||
- python3-venv | ||
- libpq-dev | ||
- libsqlite3-dev | ||
- lzma-dev | ||
- libreadline6-dev | ||
- libbz2-dev | ||
- cargo | ||
- bash | ||
- zsh | ||
- neofetch | ||
- unzip | ||
- ripgrep | ||
when: ansible_os_family == 'Debian' | ||
|
||
- name: Update Homebrew (macOS) | ||
homebrew: | ||
state: latest | ||
when: ansible_os_family == 'Darwin' | ||
|
||
- name: Install essential packages (macOS) | ||
homebrew: | ||
name: "{{ item }}" | ||
loop: | ||
- curl | ||
- wget | ||
- git | ||
- gcc | ||
- libffi | ||
- htop | ||
- xclip | ||
- make | ||
- vim | ||
- python | ||
- postgresql | ||
- sqlite | ||
- xz | ||
- readline | ||
- bzip2 | ||
- cargo | ||
- bash | ||
- zsh | ||
- neofetch | ||
- unzip | ||
- ripgrep | ||
when: ansible_os_family == 'Darwin' | ||
|
||
- name: Install fd-find (Ubuntu) | ||
apt: | ||
name: fd-find | ||
state: present | ||
when: ansible_os_family == 'Debian' | ||
|
||
- name: Install fd-find (macOS) | ||
homebrew: | ||
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: 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 }}" | ||
|