# tasks/dotfiles.yaml - name: Install stow become: true apt: name: [ "stow" ] tags: - git - install - dotfiles - productivity - name: Check if already stowed stat: path: ~/.stowed register: st tags: - git - install - dotfiles - productivity - name: Remove existing .bashrc from home file: path: ~/.bashrc state: absent when: st.stat.islnk is not defined tags: - git - install - dotfiles - productivity # - name: Clone the dotfiles repository # git: # repo: https://gitlab.com/bhavin192/dotfiles.git # dest: ~/dotfiles # when: st.stat.islnk is not defined # tags: # - install # - dotfiles # - productivity - name: Move dotfiles to dest folder ansible.builtin.copy: src: /tmp/ansible/dotfiles dest: ~/ remote_src: yes owner: root group: root # mode: u+rw,g-wx,o-rwx # validate: /usr/sbin/visudo -csf %s tags: - git - install - dotfiles - productivity - name: Stow the dotfiles shell: | stow --verbose 2 --dir "${HOME}/dotfiles" --target "${HOME}" . when: st.stat.islnk is not defined tags: - git - install - dotfiles - productivity - name: Set the right prompt ansible.builtin.lineinfile: path: ~/.bashrc regexp: '^ENVIRONMENT=.*$' line: ENVIRONMENT=PROD tags: - git - install - dotfiles - productivity