first sample playbook added

This commit is contained in:
Manuel Amador (Rudd-O) 2015-12-28 03:49:49 +00:00
parent 7faa46e5bd
commit 7afdaa1955
5 changed files with 44 additions and 0 deletions

View File

@ -8,3 +8,5 @@ as templates to get your own automation started.
* [ansible/](ansible/) contains a basic example Ansible setup.
* [qubesformation/](qubesformation/) details how to use the Qubes formation
Ansible module, used to provision VMs and enforce state on those VMs.
* [sampleplaybooks](sampleplaybooks/) contains a few sample playbooks
you can base your work upon. More samples are always welcome.

View File

@ -0,0 +1,10 @@
Qubes OS DevOps automation toolkit: sample playbooks
============================================
Here are a few sample playbooks. These assume that you already have an
[Ansible Qubes setup](../examples/ansible/) going, and so that consequently
you can drop the files of the example directly into your setup.
* [wakeupservice/](wakeupservice/) sets up a post-wakeup systemd service
in your templates. This service is not controllable via the Qubes OS
service preferences for your VMs, [but it could be](../ansible/qubes-service.yml).

View File

@ -0,0 +1,13 @@
[Unit]
Description=Run wakeup.sh after suspend
After=basic.target
After=suspend.target
After=hibernate.target
[Service]
ExecStart=/usr/local/bin/wakeup.sh
[Install]
WantedBy=basic.target
WantedBy=suspend.target
WantedBy=hibernate.target

View File

@ -0,0 +1,3 @@
#!/bin/bash
echo "I ran after suspend/hibernate"

View File

@ -0,0 +1,16 @@
---
- hosts: templatevms
sudo: True
tasks:
- name: set up service
template:
src: wakeup.service.j2
dest: /etc/systemd/system/wakeup.service
mode: 0644
- name: activate service on next boot
service: name=wakeup enabled=True
- name: copy shell script
copy:
src: wakeup.sh
dest: /usr/local/bin/wakeup.sh
mode: 0755