ansible-debops-infrastructure

Unnamed repository; edit this file 'description' to name the repository.
git clone git://git.erethon.com/ansible-debops-infrastructure
Log | Files | Refs

commit fa6514c56de139d6484ee59602d166f38d830b68
parent 20cffad1e91df9301732f0df72f50c02eab8c4ec
Author: Dionysis Grigoropoulos <dgrig@erethon.com>
Date:   Sun, 29 Apr 2018 01:54:37 +0300

openbsd: Init openbsd role, vars and playbook

Diffstat:
ansible/inventory/group_vars/openbsd/all.yml | 3+++
ansible/playbooks/base_openbsd.yml | 9+++++++++
ansible/roles/openbsd/files/installurl | 1+
ansible/roles/openbsd/tasks/main.yml | 36++++++++++++++++++++++++++++++++++++
4 files changed, 49 insertions(+), 0 deletions(-)

diff --git a/ansible/inventory/group_vars/openbsd/all.yml b/ansible/inventory/group_vars/openbsd/all.yml @@ -0,0 +1,3 @@ +--- + +openbsd__packages: ['zsh', 'git'] diff --git a/ansible/playbooks/base_openbsd.yml b/ansible/playbooks/base_openbsd.yml @@ -0,0 +1,9 @@ +--- + +- name: OpenBSD main config + hosts: [ 'openbsd', '!openbsd_exclude' ] + gather_facts: True + become: True + + roles: + - openbsd diff --git a/ansible/roles/openbsd/files/installurl b/ansible/roles/openbsd/files/installurl @@ -0,0 +1 @@ +https://ftp.fr.openbsd.org/pub/OpenBSD diff --git a/ansible/roles/openbsd/tasks/main.yml b/ansible/roles/openbsd/tasks/main.yml @@ -0,0 +1,36 @@ +--- + +- name: Copy installurl + file: + src: installurl + dest: /etc/installurl + +- name: Install packages + openbsd_pkg: + name: "{{ item }}" + state: present + with_items: + - "{{ openbsd__packages }}" + +- name: Create groups + group: + name: "{{ item.group | d(item.name) }}" + with_flattened: + - "{{ users__accounts }}" + +- name: Create management user + user: + name: "{{ item.name }}" + group: "{{ item.group }}" + state: "{{ item.state }}" + append: "{{ item.append }}" + shell: "{{ item.openbsdshell }}" + with_items: + - "{{ users__accounts }}" + +- authorized_key: + user: "{{ item.name }}" + state: present + key: "{{ item.sshkeys[0] }}" + with_items: + - "{{ users__accounts }}"