Skip to content

Instantly share code, notes, and snippets.

@nbraud
Last active April 23, 2018 11:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nbraud/e514bef994521388a0984e1a3a668854 to your computer and use it in GitHub Desktop.
Save nbraud/e514bef994521388a0984e1a3a668854 to your computer and use it in GitHub Desktop.
Test for the Ansible apt module
/.vagrant
/log
*.retry
[defaults]
inventory = ./.vagrant/provisioners/ansible/inventory
log_path = ./log
nocows=1
[ssh_connection]
ssh_args = -o UserKnownHostsFile=/dev/null -o IdentitiesOnly=yes -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no
---
- hosts: default
become: yes
tasks:
- name: Uninstall ZSH
apt:
name: zsh
state: absent
autoremove: yes
- name: Install the APT module for python
apt:
name:
- python-apt
- python3-apt
state: present
- hosts: default
become: yes
tasks:
- name: Install zsh-antigen
apt:
name: zsh-antigen
state: present
- name: Install zsh
apt:
name: zsh
state: present
- name: Uninstall zsh-antigen
apt:
name: zsh-antigen
state: absent
- name: apt autoremove
apt:
autoremove: yes
- name: Check that ZSH is installed
command: zsh -c true
Vagrant.configure("2") do |config|
config.vm.box = "debian/stretch64"
# Disable the new default behavior introduced in Vagrant 1.7, to
# ensure that all Vagrant machines will use the same SSH key pair.
# See https://github.com/mitchellh/vagrant/issues/5005
config.ssh.insert_key = false
config.vm.provision "ansible" do |ansible|
ansible.verbose = "v"
ansible.playbook = "provision.yml"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment