You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

40 lines
1.5 KiB

  1. ---
  2. - hosts: [ 'debian10' ]
  3. tasks:
  4. - name: Install direnv
  5. become_user: root
  6. shell: |
  7. command -v direnv > /dev/null || {
  8. curl -sfLo /usr/local/bin/direnv https://github.com/direnv/direnv/releases/download/v2.35.0/direnv.linux-amd64 && \
  9. chmod a+x /usr/local/bin/direnv
  10. }
  11. - name: Install Starship
  12. become_user: root
  13. shell: |
  14. command -v starship> /dev/null || {
  15. curl -sS https://starship.rs/install.sh | sh -s -- -f
  16. }
  17. - name: Install with init or update yadm
  18. become_user: root
  19. shell: |
  20. command -v yadm && {
  21. yadm remote set-url origin https://vcs.wpstudio.ru/gitea/dotfiles.git
  22. rm -rf .tmux/plugins/tmux-ip-address
  23. yadm pull && yadm checkout .
  24. } || {
  25. curl -sfLo /usr/local/bin/yadm https://github.com/TheLocehiliosan/yadm/raw/master/yadm && chmod a+x /usr/local/bin/yadm
  26. yadm clone --bootstrap https://vcs.wpstudio.ru/gitea/dotfiles.git && yadm checkout .
  27. }
  28. # For manual change: sed -i 's/#/\\$/g' ${HOME}/.config/starship.toml
  29. - name: 'Change character for non-root user'
  30. become_user: root
  31. shell: |
  32. HOME_USER=$(ls /home)
  33. test ! -z "${HOME_USER}" && su --login ${HOME_USER} -c 'yadm clone --bootstrap https://vcs.wpstudio.ru/gitea/dotfiles.git && yadm checkout .'
  34. test ! -z "${HOME_USER}" && su --login ${HOME_USER} -c 'sed -i "s/#/\\$/g" ${HOME}/.config/starship.toml'
  35. exit 0
  36. args:
  37. executable: /bin/bash