Skip to content

Instantly share code, notes, and snippets.

@cimbalo
cimbalo / deep_sleep.cpp
Created September 20, 2017 13:45
DW1000 deep sleep
/*
* Copyright (c) 2015 by Thomas Trojer <thomas@trojer.net>
* Decawave DW1000 library for arduino.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
config = ConfigParser.ConfigParser()
config.readfp(open('defaults.cfg'))
config.read(['ca_manager.cfg', os.path.expanduser('~/.ca_manager.cfg')])
- name: check certificates on vm
check_certs:
host: vm_hosts
vm:
- pastebin
-
- name: read password
shell: cat '{{ password_file }}'r
register: password_result
ignore_errors: yes
changed_when: false
- set_fact:
password: '{{ password_result.stdout }}'
when: password_result.stdout != ""
- name: container enter nursery
add_host:
name: "{{ vm_name }}"
ansible_host: "{{ ansible_host }}"
ansible_connection: "lxc_ssh"
ansible_ssh_extra_args: "{{ vm_name }}"
- name: update container network configuration
shell: lxc-attach -n {{ vm_name }} --clear-env -e -- grep 'ssh-rsa {{ user_ca_key }}' /etc/ssh/user_ca.pub || echo ssh-rsa {{ user_ca_key }} > /etc/ssh/user_ca.pub
register: shell_result
changed_when: "shell_result.stdout != 'ssh-rsa {{ user_ca_key }}'"