cleeeeaning womaaaan

This commit is contained in:
ka-ba 2016-11-24 00:28:23 +01:00
parent d37f6a4e45
commit 0167536d22
2 changed files with 4 additions and 10 deletions

View file

@ -3,18 +3,13 @@
- name: ensure backend-scripts-log-dir - name: ensure backend-scripts-log-dir
file: path=~/.cronlog state=directory mode=0700 file: path=~/.cronlog state=directory mode=0700
# FIXME: maybe move behind next block?
- name: clone backend scripts - name: clone backend scripts
git: git:
dest: "~/clones/backend-scripts" dest: "~/clones/backend-scripts"
repo: "https://github.com/freifunk-mwu/backend-scripts.git" repo: "https://github.com/freifunk-mwu/backend-scripts.git"
accept_hostkey: yes accept_hostkey: yes
#- name: generate host key
# shell: python3 ~/clones/backend-scripts/bootstrap_git_all.py
# args:
# creates: ~/.ssh/{{ansible_hostname}}_rsa
# register: keypair
- block: # replaces backend script bootstrap_git_all.py - block: # replaces backend script bootstrap_git_all.py
- name: generate host key - name: generate host key
command: ssh-keygen -t ed25519 -N "" -f {{ansible_hostname}}_rsa command: ssh-keygen -t ed25519 -N "" -f {{ansible_hostname}}_rsa
@ -50,22 +45,22 @@
# block end # block end
# FIXME: activate with ansible 2.2 ...
- block: - block:
- name: read new pubkey - name: read new pubkey
shell: cat ~/.ssh/{{ansible_hostname}}_rsa.pub shell: cat ~/.ssh/{{ansible_hostname}}_rsa.pub
register: ssh_pub_key register: ssh_pub_key
- name: read existing token from spinat - name: read existing github token from spinat
shell: cat ~/.ssh/github-ansible-token shell: cat ~/.ssh/github-ansible-token
register: github_access_token register: github_access_token
delegate_to: spinat.freifunk-mwu.de delegate_to: spinat.freifunk-mwu.de
- name: register new pubkey with github freifunkmwu account - name: register new pubkey with github freifunkmwu account
github_key: github_key:
name: "Server {{ansible_hostname}} automatic test" name: "Server {{ansible_hostname}}"
token: "{{github_access_token.stdout}}" token: "{{github_access_token.stdout}}"
pubkey: "{{ssh_pub_key.stdout}}" pubkey: "{{ssh_pub_key.stdout}}"
# FIXME: force yes ???
force: no force: no
when: keypair.changed when: keypair.changed

View file

@ -36,7 +36,6 @@
alternatives: name=editor path=/usr/bin/vim.basic alternatives: name=editor path=/usr/bin/vim.basic
become: True become: True
# enable with ansible version 2.2
- name: set timezone to Europe/Berlin - name: set timezone to Europe/Berlin
timezone: name=Europe/Berlin timezone: name=Europe/Berlin
become: True become: True