2
0

zsh.yml 901 B

12345678910111213141516171819202122232425262728293031323334353637
  1. - name: Clone oh-my-zsh
  2. git:
  3. repo: https://github.com/robbyrussell/oh-my-zsh.git
  4. dest: "{{ansible_env.HOME}}/.oh-my-zsh"
  5. # - name: Extract ohmyzsh
  6. # unarchive:
  7. # src: ohmyzsh-master.zip
  8. # dest: "{{ansible_env.HOME}}/"
  9. # - name: Rename ohmyzsh
  10. # command: mv ohmyzsh-master .oh-my-zsh
  11. # args:
  12. # chdir: "{{ansible_env.HOME}}"
  13. # creates: .oh-my-zsh
  14. - name: Setup .zshrc
  15. copy:
  16. src: "{{ansible_env.HOME}}/.oh-my-zsh/templates/zshrc.zsh-template"
  17. dest: "{{ansible_env.HOME}}/.zshrc"
  18. remote_src: true
  19. mode: 0600
  20. - name: Enable $HOME/.local
  21. ansible.builtin.lineinfile:
  22. path: "{{ansible_env.HOME}}/.zshrc"
  23. line: 'export PATH=$HOME/.local/bin:$PATH'
  24. - name: Setup EDITOR
  25. ansible.builtin.lineinfile:
  26. path: "{{ansible_env.HOME}}/.zshrc"
  27. line: 'export EDITOR=vim'
  28. - name: Use zsh
  29. become: true
  30. shell: chsh -s /bin/zsh {{ansible_user}}