2016-07-26 17:32:47 +02:00
|
|
|
---
|
|
|
|
|
|
|
|
# FIXME: do nothing for now
|
|
|
|
# FIXME: how to learn about IP of VM ???
|
|
|
|
|
2016-08-06 02:12:55 +02:00
|
|
|
- name: prepare escalation
|
|
|
|
set_fact: ansible_become_pass=bloed ansible_ssh_pass=bloed
|
|
|
|
|
2016-08-12 00:39:25 +02:00
|
|
|
#- name: ensure absence of local known-hosts entry FIXME remove here
|
|
|
|
# known_hosts: host={{ansible_host}} state=absent
|
|
|
|
# delegate_to: 127.0.0.1 # local action
|
|
|
|
|
|
|
|
#- name: do dummy commit to ensure known host key
|
|
|
|
# command: ssh -o PasswordAuthentication=no -o StrictHostKeyChecking=no hein@{{ansible_host}} true
|
|
|
|
# delegate_to: 127.0.0.1 # local action
|
|
|
|
# changed_when: False
|
|
|
|
# failed_when: False
|
|
|
|
|
2016-08-06 02:12:55 +02:00
|
|
|
- name: ensure admin user
|
|
|
|
user: comment="FFMWU Administrator" name=admin shell=/bin/bash state=present
|
2016-08-12 00:39:25 +02:00
|
|
|
|
|
|
|
- name: ensure users ssh key to admin user
|
|
|
|
authorized_key: user=admin key="{{ lookup('file', '~/.ssh/id_rsa.pub') }}"
|
2016-09-14 16:39:21 +02:00
|
|
|
exclusive=no
|
2016-08-12 00:39:25 +02:00
|
|
|
|
|
|
|
- name: ensure users ssh key to bootstrap user
|
|
|
|
authorized_key: user=hein key="{{ lookup('file', '~/.ssh/id_rsa.pub') }}"
|
2017-09-17 14:43:54 +02:00
|
|
|
become: false
|
2016-08-12 00:39:25 +02:00
|
|
|
|
|
|
|
- name: ensure no-pw sudo capability for admin and bootstrap user
|
|
|
|
lineinfile:
|
|
|
|
create: yes
|
|
|
|
dest: /etc/sudoers.d/ffmwu
|
|
|
|
line: "admin,hein ALL = (root) NOPASSWD: ALL"
|
|
|
|
mode: 0440
|
|
|
|
validate: visudo -c -f %s
|
|
|
|
|
|
|
|
- name: from this point on prevent pw for bootstrap user
|
|
|
|
user: user=hein password=X
|