From 9285db9da9f0ed137c37312bb0a89e2c5731627e Mon Sep 17 00:00:00 2001 From: root Date: Sun, 27 Sep 2026 19:57:47 +0000 Subject: [PATCH] Nejake minule zmeny --- inventory.yml | 5 +++ playbooks/first.yml | 2 +- playbooks/initsystem.yml | 68 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 74 insertions(+), 1 deletion(-) create mode 100644 inventory.yml create mode 100644 playbooks/initsystem.yml diff --git a/inventory.yml b/inventory.yml new file mode 100644 index 0000000..709bb76 --- /dev/null +++ b/inventory.yml @@ -0,0 +1,5 @@ +--- +mailservers: + hosts: + devtest: + ansible_host: 192.168.162.37 diff --git a/playbooks/first.yml b/playbooks/first.yml index 5f7626e..a7191df 100644 --- a/playbooks/first.yml +++ b/playbooks/first.yml @@ -1,6 +1,6 @@ --- - name: Prvni Playbook - hosts: localhost + hosts: devtest tasks: - name: "Test Connectivity" diff --git a/playbooks/initsystem.yml b/playbooks/initsystem.yml new file mode 100644 index 0000000..43021bd --- /dev/null +++ b/playbooks/initsystem.yml @@ -0,0 +1,68 @@ +# Jen kopie vim.yml, kterou chci upravit +# +# Nainstaluje vim, Pathogen, gruvbox + +- name: Konfigurace Vimu + hosts: devtest + gather_facts: yes + become: no + + vars: + vim_dir: "{{ ansible_env.HOME }}/.vim" + vimrc: "{{ ansible_env.HOME }}/.vimrc" + bashrc: "{{ ansible_env.HOME }}/.bashrc" + + tasks: + - name: Upgrade balicku + become: yes + ansible.builtin.apt: + update_cache: true + upgrade: full + - name: Instalace Balicku + become: yes + package: + name: "{{ item }}" + state: present + loop: + - [ vim, git, mc, curl, wget ] + + - name: Stazeni dotfiles + get_url: + dest: "{{ item.dst }}" + url: "{{ item.src }}" + backup: yes + force: true + mode: 0640 + loop: + - {src: "https://www.martus.cz/soubory/ansible/bashrc.txt", dst: "{{ bashrc }}" } + - {src: "https://www.martus.cz/soubory/ansible/vimrc.txt", dst: "{{ vimrc }}" } + + - name: Adresarova struktura + file: + path: "{{ item }}" + state: directory + owner: ansibler + group: ansibler + mode: 0750 + loop: + - "{{ vim_dir }}" + - "{{ vim_dir }}/swap" + - "{{ vim_dir }}/backup" + - "{{ vim_dir }}/autoload" + - "{{ vim_dir }}/bundle" + + - name: Pathogen pro instalaci doplnku + get_url: + dest: "{{ vim_dir }}/autoload/pathogen.vim" + url: https://tpo.pe/pathogen.vim + + - name: Vim Pluginy + git: + dest: "{{ vim_dir }}/bundle/{{ item.name }}" + repo: "{{ item.url }}" + clone: yes + update: yes + recursive: no + loop: + - { name: gruvbox, url: https://github.com/morhetz/gruvbox.git } +