konfigurace vimu
This commit is contained in:
@@ -1,12 +0,0 @@
|
||||
---
|
||||
- name: Instalace Dovecotu
|
||||
hosts: mailservers
|
||||
|
||||
tasks:
|
||||
- name: NonPriv test
|
||||
ping:
|
||||
- name: Install Dovecot
|
||||
ansible.builtin.apt:
|
||||
name: vim
|
||||
state: present
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
---
|
||||
- name: Prvni Playbook
|
||||
hosts: devtest
|
||||
|
||||
tasks:
|
||||
- name: "Test Connectivity"
|
||||
ping:
|
||||
@@ -1,10 +0,0 @@
|
||||
---
|
||||
- name: 2nd Playbook
|
||||
hosts: localhost
|
||||
|
||||
tasks:
|
||||
- name: Print Hello World
|
||||
debug: msg="Hello World"
|
||||
|
||||
- name: pingtest
|
||||
ping:
|
||||
@@ -1,24 +1,24 @@
|
||||
# Jen kopie vim.yml, kterou chci upravit
|
||||
# Ma za ukol vytvorit uzivatele ansibler, nahrat mu klic, a zrusit klic z roota z onboardingu
|
||||
# Init Ansible playbook
|
||||
|
||||
- name: Konfigurace Vimu
|
||||
hosts: devtest
|
||||
- name: Inicializacni Playbook
|
||||
hosts: all
|
||||
gather_facts: yes
|
||||
become: no
|
||||
remote_user: root
|
||||
|
||||
tasks:
|
||||
- name: Uzivatelske Ucty
|
||||
- name: Vyrobit uzivatele Ansibler
|
||||
user:
|
||||
name: ansibler
|
||||
create_home: true
|
||||
comment: "JCH"
|
||||
shell: "/bin/bash"
|
||||
- name: instalace sudo
|
||||
- name: Instalace sudo
|
||||
apt:
|
||||
name: sudo
|
||||
state: present
|
||||
update_cache: true
|
||||
- name: ansible sudoer
|
||||
- name: uzivatel Ansibler bude sudo
|
||||
copy:
|
||||
owner: root
|
||||
group: root
|
||||
@@ -36,7 +36,7 @@
|
||||
path: "{{ item.path }}"
|
||||
loop:
|
||||
- {path: "/home/ansibler/.ssh"}
|
||||
- name: SSH klic ansibler
|
||||
- name: SSH klic uzivatele Ansibler
|
||||
copy:
|
||||
owner: ansibler
|
||||
group: ansibler
|
||||
@@ -50,5 +50,3 @@
|
||||
path: /root/.ssh/authorized_keys
|
||||
state: absent
|
||||
|
||||
|
||||
|
||||
|
||||
96
playbooks/initsystem2.yml
Normal file
96
playbooks/initsystem2.yml
Normal file
@@ -0,0 +1,96 @@
|
||||
---
|
||||
- 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 }
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
- name: upgrade balicku
|
||||
hosts: devtest
|
||||
hosts: all
|
||||
|
||||
tasks:
|
||||
- name: update a upgrade
|
||||
|
||||
@@ -1,58 +0,0 @@
|
||||
---
|
||||
- name: playbook pro vytoceni gitu (je rozsirenim update-pkgs)
|
||||
hosts: devtest
|
||||
|
||||
tasks:
|
||||
- name: update a upgrade
|
||||
become: yes
|
||||
apt:
|
||||
update_cache: true
|
||||
upgrade: full
|
||||
|
||||
- name: Uzivatel martus
|
||||
become: yes
|
||||
user:
|
||||
name: martus
|
||||
create_home: true
|
||||
comment: "Martus Dortus"
|
||||
shell: "/bin/bash"
|
||||
- name: Adresarova Struktura /home/martus
|
||||
become: yes
|
||||
file:
|
||||
state: directory
|
||||
force: true
|
||||
mode: 0750
|
||||
owner: martus
|
||||
group: martus
|
||||
path: "{{ item.path }}"
|
||||
loop:
|
||||
- {path: "/home/martus/.ssh"}
|
||||
- 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: Instalace Balicku
|
||||
become: yes
|
||||
package:
|
||||
name: "{{ item }}"
|
||||
state: present
|
||||
loop:
|
||||
- [ vim, mc, curl, wget, btop ]
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user