Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 22 additions & 19 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,33 @@
---
language: python
python: "3.6"
python:
- "3.6"

# Use the new container infrastructure
sudo: false
services:
- docker

# Install ansible
addons:
apt:
packages:
- python-pip
git:
depth: 3

install:
# Install ansible
- pip install ansible

# Check ansible version
- ansible --version
before_install:
- sudo -H apt-get update -qq
- sudo -H apt-get install -qq python-apt python-pycurl

# Create ansible.cfg with correct roles_path
- printf '[defaults]\nroles_path=../' >ansible.cfg
install:
- sudo -H pip install http://releases.ansible.com/ansible/ansible-2.2.1.0.tar.gz
- sudo -H pip install docker-py==1.10.6
- sudo -H pip install netaddr==0.7.19
- echo -e 'localhost ansible_connection=local' > tests/inventory
- echo -e '[defaults]\nroles_path = ../\nhostfile = ./tests/inventory' > ansible.cfg

script:
# Basic role syntax check
- ansible-playbook tests/test.yml -i tests/inventory --syntax-check
- ansible-playbook tests/test.yml --syntax-check
# - ansible-playbook -v --diff tests/test.yml
# - >
# ansible-playbook tests/test.yml
# | grep -q 'changed=0.*failed=0'
# && (echo 'Idempotence test: pass' && exit 0)
# || (echo 'Idempotence test: fail' && exit 1)

notifications:
webhooks: https://galaxy.ansible.com/api/v1/notifications/

6 changes: 3 additions & 3 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
update_cache: yes
upgrade: full

- import_tasks: config_user.yaml
- import_tasks: config_ssh.yaml
- import_tasks: config_ufw.yaml
- import_tasks: config_user.yml
- import_tasks: config_ssh.yml
- import_tasks: config_ufw.yml
15 changes: 15 additions & 0 deletions tests/insecure_key
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
-----BEGIN RSA PRIVATE KEY-----
MIICXAIBAAKBgQC91VhmJVEdWQ0OPrxnVHzXhPA+3KFlx50HENl1Mc0Y7Q9IY01x
IgT3+cLENienlpwDM/9LgUvP7Ql7fF+yXGaOz5wdvm0/WkyPnf8bSxDeAI1tEFRH
Vx2i9euRcGBs65F8NVIdW3/oD8B9ykyXbyvt+4uMh2VO6Em/kD8cl2EQ6wIDAQAB
AoGBAIjKiJWqhEXqmo7OREMNTZybzebuY1sNOSkTSi+6ADna8S1PaUmBoyTxlBiB
kZeg3rEsMeW9uNyOyUtzdx32mWtEp0NHtRjukYeh/tJrF4vujqNPgUeASaw5uVXe
8DkZqwrT/79atSyEMwRjbuCvp5wCmC7hRMO8yiz3if9Gi8XpAkEA/IuLl+LwWizr
znrsPxGKR8/LdD8A7leMvotmkktkMyqWuqMDKxIQFAUPj8suysUnMSmox3J990sv
bk2ra4MBJwJBAMBuLFdx+IzqwiHNcGKKozUFi4vI6VBV6mW58ywQ7MKXph66E98U
sOhjPEc/nXtZA8jx3tdq1XyJ3/0hWkVNRJ0CQHlpUQQFS03e+MK8n+U2NoeNo59Q
Rs9O8dANTpOYgSSEHhC+G+DR/z7QrAmSQf2jyNK+13CDX4HK+JOL7ZRzV9MCQHMM
q+gwVQlzhlQNbycLep7FzPPrUEtewsDFV3U+PT/uyTxPxne2+DpIso5qo25O/ytS
KQikcDWAfXHrUfxjQSUCQDmDMs2Z7zMMd1424Il9e9aGWaULeczw93Tk8VDvzjJ4
r9Ks1bL6itBBwRKxT6jXEorTpzoedrNw7Pmtw3ntyIQ=
-----END RSA PRIVATE KEY-----
1 change: 1 addition & 0 deletions tests/insecure_key.pub
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQC91VhmJVEdWQ0OPrxnVHzXhPA+3KFlx50HENl1Mc0Y7Q9IY01xIgT3+cLENienlpwDM/9LgUvP7Ql7fF+yXGaOz5wdvm0/WkyPnf8bSxDeAI1tEFRHVx2i9euRcGBs65F8NVIdW3/oD8B9ykyXbyvt+4uMh2VO6Em/kD8cl2EQ6w== [email protected]
12 changes: 9 additions & 3 deletions tests/test.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
---
- hosts: localhost
remote_user: root
- hosts: all
become: true
roles:
- ansible-secure-server
- ansible-secure-server
vars:
gitlab_ports:
deploy_group: test_group
deploy_user: test_user
ssh_dir: "./"
ssh_key_name: insecure_key