dotfiles/vim/UltiSnips/yaml.snippets

57 lines
1.1 KiB
Plaintext
Raw Permalink Normal View History

snippet mainrole "Snippet for the main file of a playbook." b
---
# ${1:Description of the role}
- name: Installation
ansible.builtin.import_tasks: install/main.yml
tags:
- ${2:basetag}
- $2-install
- name: Configuration
ansible.builtin.import_tasks: config/main.yml
tags:
- $2
- $2-config
- name: Firewall configuration
ansible.builtin.import_tasks: firewall/main.yml
tags:
- $2
- $2-firewall
$0
endsnippet
snippet playbook "Creates an empty playbook." b
---
- hosts: all
roles:
- ${1:${VISUAL:rolename}}$0
become: yes
become_user: root
endsnippet
snippet shellpipe "Creates a task with module shell and which supports pipes." b
- name: ${1:${VISUAL:Title}}
ansible.builtin.shell: >
set -o pipefail;
$0
args:
executable: /bin/bash
endsnippet
snippet compose "Creates the skeleton of a docker-compose.yml file." b
---
version: '3'
services:
${1:${VISUAL:container}}:
image: ${2:image}
container_name: $1
restart: unless-stopped
environment: $0
ports:
volumes:
networks:
endsnippet