Skip to content

Instantly share code, notes, and snippets.

@tasdikrahman
Created April 7, 2017 05:57
Show Gist options
  • Save tasdikrahman/e402533172ecd7a172f2726152de45a3 to your computer and use it in GitHub Desktop.
Save tasdikrahman/e402533172ecd7a172f2726152de45a3 to your computer and use it in GitHub Desktop.
---
sudo: required
dist: trusty
language: python
python: "2.7"
# Doc: https://docs.travis-ci.com/user/customizing-the-build#Build-Matrix
env:
- ANSIBLE_VERSION=latest
- ANSIBLE_VERSION=2.2.2.0
- ANSIBLE_VERSION=2.2.1.0
- ANSIBLE_VERSION=2.2.0.0
- ANSIBLE_VERSION=2.1.5
- ANSIBLE_VERSION=2.1.4
- ANSIBLE_VERSION=2.1.3
- ANSIBLE_VERSION=2.1.2
- ANSIBLE_VERSION=2.1.1.0
- ANSIBLE_VERSION=2.1.0.0
- ANSIBLE_VERSION=2.0.2.0
- ANSIBLE_VERSION=2.0.1.0
- ANSIBLE_VERSION=2.0.0.2
- ANSIBLE_VERSION=2.0.0.1
- ANSIBLE_VERSION=2.0.0.0
- ANSIBLE_VERSION=1.9.6
branches:
only:
- master
before_install:
- sudo apt-get update -qq
install:
# Install Ansible.
- if [ "$ANSIBLE_VERSION" = "latest" ]; then pip install ansible; else pip install ansible==$ANSIBLE_VERSION; fi
- if [ "$ANSIBLE_VERSION" = "latest" ]; then pip install ansible-lint; fi
script:
# Check the role/playbook's syntax.
- ansible-playbook -i tests/inventory tests/test.yml --syntax-check
# Run the role/playbook with ansible-playbook.
- ansible-playbook -i tests/inventory tests/test.yml -vvvv --skip-tags update,copy_host_ssh_id
# check is the user is created or not
- id -u tasdik | grep -q "no" && (echo "user not found" && exit 1) || (echo "user found" && exit 0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment