Rearanged the playbook to use ansible roles:
http://docs.ansible.com/ansible/playbooks_roles.html also made keystone run
This commit is contained in:
15
roles/common/tasks/docker.yml
Normal file
15
roles/common/tasks/docker.yml
Normal file
@ -0,0 +1,15 @@
|
||||
---
|
||||
- apt_key:
|
||||
id: 58118E89F3A912897C070ADBF76221572C52609D
|
||||
keyserver: hkp://p80.pool.sks-keyservers.net:80
|
||||
state: present
|
||||
|
||||
- apt_repository:
|
||||
repo: deb https://apt.dockerproject.org/repo ubuntu-xenial main
|
||||
update_cache: yes
|
||||
|
||||
- name: install docker
|
||||
apt: pkg={{ item }} state=latest
|
||||
with_items:
|
||||
- docker-engine
|
||||
- python-docker
|
28
roles/common/tasks/main.yml
Normal file
28
roles/common/tasks/main.yml
Normal file
@ -0,0 +1,28 @@
|
||||
- group:
|
||||
name: admin
|
||||
state: present
|
||||
|
||||
- name: Passwordless sudo for admins
|
||||
lineinfile: dest=/etc/sudoers line="%admin ALL=(ALL:ALL) NOPASSWD:ALL"
|
||||
|
||||
- include: users.yml
|
||||
|
||||
- name: common | install packages
|
||||
apt: pkg={{ item }} state=latest update_cache=yes
|
||||
with_items:
|
||||
- curl
|
||||
- htop
|
||||
- molly-guard
|
||||
- sudo
|
||||
- tree
|
||||
- vim
|
||||
- python-simplejson
|
||||
|
||||
- name: sshd_config
|
||||
file:
|
||||
src: files/sshd_config
|
||||
dest: /etc/ssh/sshd_config
|
||||
mode: 0644
|
||||
owner: root
|
||||
group: root
|
||||
|
21
roles/common/tasks/users.yml
Normal file
21
roles/common/tasks/users.yml
Normal file
@ -0,0 +1,21 @@
|
||||
---
|
||||
# Tasks to set users
|
||||
- user:
|
||||
group: admin
|
||||
name: "{{ item }}"
|
||||
with_items:
|
||||
- egon
|
||||
- wim
|
||||
|
||||
- name: wim key
|
||||
authorized_key:
|
||||
user: wim
|
||||
key: 'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDPcJbucOFOFrPZwM1DKOvscYpDGYXKsgeh3/6skmZn/IhLWYHY6oanm4ifmY3kU0oNXpKgHR43x3JdkIRKmrEpYULspwdlj/ZKPYxFWhVaSTjJvmSJEgy7ET1xk+eVoKV1xRWm/BugWpbseFAOcI9ZwfH++S8JhfX6GgCIy06RUpM8EcFAWb/GO699ZnQ67qMxNdSWYHtK1zu+9svWgEzPk4zc2TihJsc7DxcfQCNfQ4vKH1Im3+QfG5bRtdyVl9yjbE+o4EWhPEWsTBgBosJfbqfywsuzibhTgyybR0Zzm4JN6Wh5wVazvNutAB291dIJt22XEx5tCyOAjLPybLy3 wim@wim-HP-Compaq-Elite-8300-MT'
|
||||
state: present
|
||||
|
||||
- name: egon_key
|
||||
authorized_key:
|
||||
user: egon
|
||||
key: 'ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKUBdTEHUj6MxvfEU7KcI+UPAvqJ9jGJ7hHm3e7XFTb9 egon@egon-pc'
|
||||
state: present
|
||||
|
Reference in New Issue
Block a user