stare playbooky

This commit is contained in:
root
2026-09-24 09:37:28 +00:00
parent 8063bf83fc
commit e3402a6f86
4 changed files with 95 additions and 0 deletions

12
playbooks/dovecot.yml Normal file
View File

@@ -0,0 +1,12 @@
---
- name: Instalace Dovecotu
hosts: mailservers
tasks:
- name: NonPriv test
ping:
- name: Install Dovecot
ansible.builtin.apt:
name: vim
state: present

7
playbooks/first.yml Normal file
View File

@@ -0,0 +1,7 @@
---
- name: Prvni Playbook
hosts: localhost
tasks:
- name: "Test Connectivity"
ping:

10
playbooks/hw.yml Normal file
View File

@@ -0,0 +1,10 @@
---
- name: 2nd Playbook
hosts: localhost
tasks:
- name: Print Hello World
debug: msg="Hello World"
- name: pingtest
ping:

66
playbooks/vim.yml Normal file
View File

@@ -0,0 +1,66 @@
# Nainstaluje vim, Pathogen, gruvbox
- name: Konfigurace Vimu
hosts: mailservers
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 }