Rearanged the playbook to use ansible roles:
http://docs.ansible.com/ansible/playbooks_roles.html also made keystone run
This commit is contained in:
88
roles/common/files/sshd_config
Normal file
88
roles/common/files/sshd_config
Normal file
@ -0,0 +1,88 @@
|
||||
# Package generated configuration file
|
||||
# See the sshd_config(5) manpage for details
|
||||
|
||||
# What ports, IPs and protocols we listen for
|
||||
Port 22
|
||||
# Use these options to restrict which interfaces/protocols sshd will bind to
|
||||
#ListenAddress ::
|
||||
#ListenAddress 0.0.0.0
|
||||
Protocol 2
|
||||
# HostKeys for protocol version 2
|
||||
HostKey /etc/ssh/ssh_host_rsa_key
|
||||
HostKey /etc/ssh/ssh_host_dsa_key
|
||||
HostKey /etc/ssh/ssh_host_ecdsa_key
|
||||
HostKey /etc/ssh/ssh_host_ed25519_key
|
||||
#Privilege Separation is turned on for security
|
||||
UsePrivilegeSeparation yes
|
||||
|
||||
# Lifetime and size of ephemeral version 1 server key
|
||||
KeyRegenerationInterval 3600
|
||||
ServerKeyBits 1024
|
||||
|
||||
# Logging
|
||||
SyslogFacility AUTH
|
||||
LogLevel INFO
|
||||
|
||||
# Authentication:
|
||||
LoginGraceTime 120
|
||||
PermitRootLogin prohibit-password
|
||||
StrictModes yes
|
||||
|
||||
RSAAuthentication yes
|
||||
PubkeyAuthentication yes
|
||||
#AuthorizedKeysFile %h/.ssh/authorized_keys
|
||||
|
||||
# Don't read the user's ~/.rhosts and ~/.shosts files
|
||||
IgnoreRhosts yes
|
||||
# For this to work you will also need host keys in /etc/ssh_known_hosts
|
||||
RhostsRSAAuthentication no
|
||||
# similar for protocol version 2
|
||||
HostbasedAuthentication no
|
||||
# Uncomment if you don't trust ~/.ssh/known_hosts for RhostsRSAAuthentication
|
||||
#IgnoreUserKnownHosts yes
|
||||
|
||||
# To enable empty passwords, change to yes (NOT RECOMMENDED)
|
||||
PermitEmptyPasswords no
|
||||
|
||||
# Change to yes to enable challenge-response passwords (beware issues with
|
||||
# some PAM modules and threads)
|
||||
ChallengeResponseAuthentication no
|
||||
|
||||
# Change to no to disable tunnelled clear text passwords
|
||||
#PasswordAuthentication yes
|
||||
|
||||
# Kerberos options
|
||||
#KerberosAuthentication no
|
||||
#KerberosGetAFSToken no
|
||||
#KerberosOrLocalPasswd yes
|
||||
#KerberosTicketCleanup yes
|
||||
|
||||
# GSSAPI options
|
||||
#GSSAPIAuthentication no
|
||||
#GSSAPICleanupCredentials yes
|
||||
|
||||
X11Forwarding yes
|
||||
X11DisplayOffset 10
|
||||
PrintMotd no
|
||||
PrintLastLog yes
|
||||
TCPKeepAlive yes
|
||||
#UseLogin no
|
||||
|
||||
#MaxStartups 10:30:60
|
||||
#Banner /etc/issue.net
|
||||
|
||||
# Allow client to pass locale environment variables
|
||||
AcceptEnv LANG LC_*
|
||||
|
||||
Subsystem sftp /usr/lib/openssh/sftp-server
|
||||
|
||||
# Set this to 'yes' to enable PAM authentication, account processing,
|
||||
# and session processing. If this is enabled, PAM authentication will
|
||||
# be allowed through the ChallengeResponseAuthentication and
|
||||
# PasswordAuthentication. Depending on your PAM configuration,
|
||||
# PAM authentication via ChallengeResponseAuthentication may bypass
|
||||
# the setting of "PermitRootLogin without-password".
|
||||
# If you just want the PAM account and session checks to run without
|
||||
# PAM authentication, then enable this but set PasswordAuthentication
|
||||
# and ChallengeResponseAuthentication to 'no'.
|
||||
UsePAM yes
|
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