mirror of
				https://github.com/Rudd-O/ansible-qubes.git
				synced 2025-10-31 19:48:54 +01:00 
			
		
		
		
	first sample playbook added
This commit is contained in:
		
							parent
							
								
									7faa46e5bd
								
							
						
					
					
						commit
						7afdaa1955
					
				| @ -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. | ||||
|  | ||||
							
								
								
									
										10
									
								
								examples/sampleplaybooks/README.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										10
									
								
								examples/sampleplaybooks/README.md
									
									
									
									
									
										Normal 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). | ||||
							
								
								
									
										13
									
								
								examples/sampleplaybooks/wakeupservice/wakeup.service.j2
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										13
									
								
								examples/sampleplaybooks/wakeupservice/wakeup.service.j2
									
									
									
									
									
										Normal 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 | ||||
							
								
								
									
										3
									
								
								examples/sampleplaybooks/wakeupservice/wakeup.sh
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										3
									
								
								examples/sampleplaybooks/wakeupservice/wakeup.sh
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,3 @@ | ||||
| #!/bin/bash | ||||
| 
 | ||||
| echo "I ran after suspend/hibernate" | ||||
							
								
								
									
										16
									
								
								examples/sampleplaybooks/wakeupservice/wakeupservice.yml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										16
									
								
								examples/sampleplaybooks/wakeupservice/wakeupservice.yml
									
									
									
									
									
										Normal 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 | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Manuel Amador (Rudd-O)
						Manuel Amador (Rudd-O)