diff --git a/main.yaml b/main.yaml deleted file mode 100644 index 64e1f04..0000000 --- a/main.yaml +++ /dev/null @@ -1,84 +0,0 @@ -# yaml-language-server: $schema=https://json.schemastore.org/ansible-playbook.json ---- -- hosts: localhost - tasks: - - name: Install Zsh packages - package: - name: zsh - state: present - - - name: Install Zsh Debian packages - when: ansible_os_family == "Debian" - apt: - name: '{{item}}' - state: present - become: true - with_items: - - zsh-doc - - pinentry-curses - - unzip - - - name: Clone Zsh Git Repositories - git: - repo: '{{item.repo}}' - dest: '{{item.dest}}' - with_items: - - repo: https://github.com/zsh-users/zsh-autosuggestions.git - dest: ~/.config/zsh/zsh-autosuggestions - - repo: https://github.com/zsh-users/zsh-history-substring-search.git - dest: ~/.config/zsh/zsh-history-substring-search - - repo: https://github.com/zsh-users/zsh-syntax-highlighting.git - dest: ~/.config/zsh/zsh-syntax-highlighting - - repo: https://github.com/zsh-users/zsh-completions.git - dest: ~/.config/zsh/zsh-completions - - repo: https://github.com/junegunn/fzf.git - dest: ~/.config/zsh/fzf - - - name: Install fzf binaries - command: - cmd: ~/.config/zsh/fzf/install --bin - creates: ~/.config/zsh/fzf/bin/fzf - - - name: Create Zsh symboic links - file: - state: link - src: '{{item.src}}' - dest: '{{item.dest}}' - with_items: - - src: ~/.config/zsh/zlogin - dest: ~/.zlogin - - src: ~/.config/zsh/zlogout - dest: ~/.zlogout - - src: ~/.config/zsh/zprofile - dest: ~/.zprofile - - src: ~/.config/zsh/zshenv - dest: ~/.zshenv - - src: ~/.config/zsh/zshrc - dest: ~/.zshrc - - src: ~/.config/zsh/prompt_fresh_setup - dest: ~/.local/share/zsh/site-functions/prompt_fresh_setup - - src: ~/.config/zsh/build/_build-dir - dest: ~/.local/share/zsh/site-functions/_build-dir - - src: ~/.config/zsh/sandbox/_sandbox - dest: ~/.local/share/zsh/site-functions/_sandbox - - src: ~/.config/zsh/layout/_layout - dest: ~/.local/share/zsh/site-functions/_layout - - src: ~/.config/zsh/notes/_note - dest: ~/.local/share/zsh/site-functions/_note - - src: ~/.config/zsh/fzf/bin/fzf - dest: ~/.local/bin/fzf - - src: ~/.config/zsh/fzf/bin/fzf-tmux - dest: ~/.local/bin/fzf-tmux - - src: ~/.config/zsh/cmake-uninstall - dest: ~/.local/bin/cmake-uninstall - - - name: Get absolute path to Zsh - shell: which zsh - register: zsh - changed_when: false - - - name: Set default shell to Zsh - user: - name: '{{lookup("env", "USER")}}' - shell: '{{zsh.stdout}}' - become: true diff --git a/tasks.yaml b/tasks.yaml new file mode 100644 index 0000000..dae1f93 --- /dev/null +++ b/tasks.yaml @@ -0,0 +1,81 @@ +--- +- name: zsh install packages + package: + name: zsh + state: present + +- name: zsh install Debian packages + when: ansible_os_family == "Debian" + apt: + name: '{{item}}' + state: present + become: true + with_items: + - zsh-doc + - pinentry-curses + - unzip + +- name: zsh clone plugin repos + git: + repo: '{{item.repo}}' + dest: '{{item.dest}}' + with_items: + - repo: https://github.com/zsh-users/zsh-autosuggestions.git + dest: ~/.config/zsh/zsh-autosuggestions + - repo: https://github.com/zsh-users/zsh-history-substring-search.git + dest: ~/.config/zsh/zsh-history-substring-search + - repo: https://github.com/zsh-users/zsh-syntax-highlighting.git + dest: ~/.config/zsh/zsh-syntax-highlighting + - repo: https://github.com/zsh-users/zsh-completions.git + dest: ~/.config/zsh/zsh-completions + - repo: https://github.com/junegunn/fzf.git + dest: ~/.config/zsh/fzf + +- name: zsh install fzf binaries + command: + cmd: ~/.config/zsh/fzf/install --bin + creates: ~/.config/zsh/fzf/bin/fzf + +- name: zsh create symboic links + file: + state: link + src: '{{item.src}}' + dest: '{{item.dest}}' + with_items: + - src: ~/.config/zsh/zlogin + dest: ~/.zlogin + - src: ~/.config/zsh/zlogout + dest: ~/.zlogout + - src: ~/.config/zsh/zprofile + dest: ~/.zprofile + - src: ~/.config/zsh/zshenv + dest: ~/.zshenv + - src: ~/.config/zsh/zshrc + dest: ~/.zshrc + - src: ~/.config/zsh/prompt_fresh_setup + dest: ~/.local/share/zsh/site-functions/prompt_fresh_setup + - src: ~/.config/zsh/build/_build-dir + dest: ~/.local/share/zsh/site-functions/_build-dir + - src: ~/.config/zsh/sandbox/_sandbox + dest: ~/.local/share/zsh/site-functions/_sandbox + - src: ~/.config/zsh/layout/_layout + dest: ~/.local/share/zsh/site-functions/_layout + - src: ~/.config/zsh/notes/_note + dest: ~/.local/share/zsh/site-functions/_note + - src: ~/.config/zsh/fzf/bin/fzf + dest: ~/.local/bin/fzf + - src: ~/.config/zsh/fzf/bin/fzf-tmux + dest: ~/.local/bin/fzf-tmux + - src: ~/.config/zsh/cmake-uninstall + dest: ~/.local/bin/cmake-uninstall + +- name: zsh get absolute path + shell: which zsh + register: zsh + changed_when: false + +- name: zsh set default shell + user: + name: '{{lookup("env", "USER")}}' + shell: '{{zsh.stdout}}' + become: true