--- - name: Inicializace systemu 2 hosts: all tasks: - name: update a upgrade become: yes apt: update_cache: true upgrade: full - name: Instalace Balicku become: yes package: name: "{{ item }}" state: present loop: - [ vim, git, mc, curl, wget, btop ] - name: Uzivatel martus become: yes user: name: martus create_home: true comment: "Martus Dortus" shell: "/bin/bash" - name: Adresarova Struktura /home/martus vars: homedir_path: "/home/martus/" become: yes file: state: directory force: true mode: 0750 owner: martus group: martus path: "{{ item }}" loop: - "{{ homedir_path }}.ssh" - "{{ homedir_path }}.vim" - "{{ homedir_path }}.vim/swap" - "{{ homedir_path }}.vim/backup" - "{{ homedir_path }}.vim/bundle" - "{{ homedir_path }}.vim/autoload" - name: Stazeni dotfiles become: yes vars: homedir_path: "/home/martus/" get_url: dest: "{{ item.dst }}" url: "{{ item.src }}" backup: yes force: true mode: 0640 owner: martus group: martus loop: - {src: "https://www.martus.cz/soubory/ansible/bashrc.txt", dst: "{{ homedir_path }}.bashrc"} - {src: "https://www.martus.cz/soubory/ansible/vimrc.txt", dst: "{{ homedir_path }}.vimrc"} - {src: "https://tpo.pe/pathogen.vim", dst: "{{ homedir_path }}.vim/autoload/pathogen.vim"} - name: SSH klice martus become: yes copy: owner: martus group: martus mode: 0750 src: "{{ item.src }}" dest: "{{item .dst }}" loop: - {src: "../soubory/klice/martus/authorized_keys", dst: "/home/martus/.ssh/authorized_keys"} - name: martus sudo become: yes copy: owner: root group: root mode: 700 src: /root/gitrepo/ansible/soubory/sudo/martus dest: /etc/sudoers.d/martus - name: Vim Pluginy become: yes vars: homedir_path: "/home/martus/" git: dest: "{{ homedir_path }}.vim/bundle/{{ item.name }}" repo: "{{ item.url }}" clone: yes update: yes recursive: no loop: - { name: gruvbox, url: https://github.com/morhetz/gruvbox.git }