Skip to content
This repository has been archived by the owner on Nov 17, 2020. It is now read-only.

use new Docker images #8

Merged
merged 1 commit into from
Jul 23, 2017
Merged

use new Docker images #8

merged 1 commit into from
Jul 23, 2017

Conversation

rndmh3ro
Copy link
Member

This uses my own docker images (https://github.com/rndmh3ro/docker-ansible). These are just the base images with pre-installed Docker to save time and hassle when testing the roles.
This also enables full travis testing of all supported operating systems!

This too removes ansible 1.9 support, to better test the role. Also there's no more support for Ansible < 2.0, see https://groups.google.com/forum/#!topic/ansible-devel/6-6FdxZ94kc.

There are no changes in the nginx-configuration itself. Though the tests will fail. I'll fix this once this PR is merged.

@artem-sidorenko
Copy link
Member

I can have a look here once ssh-hardening 2.0 is released:-)

@@ -1,18 +1,27 @@
---
driver:
name: vagrant
driver_config:
http_proxy: <%= ENV['http_proxy'] || nil %>
Copy link
Member

@artem-sidorenko artem-sidorenko Feb 13, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I usually set this in the global local Vagrantfile, so it works absolutely with all (foreign too) Vagrant and kitchen files for me:

$ cat ~/.vagrant.d/Vagrantfile
Vagrant.configure("2") do |config|
  if Vagrant.has_plugin?('vagrant-proxyconf')
    config.proxy.http     = ENV['http_proxy'] if ENV.key?('http_proxy')
    config.proxy.https    = ENV['https_proxy'] if ENV.key?('https_proxy')
    config.yum_proxy.http = ENV['https_proxy'] if ENV.key?('https_proxy')
    config.proxy.no_proxy = ENV['no_proxy'] if ENV.key?('no_proxy')
  end

  if !ENV["GLOBAL_VAGRANT_CACHIER_DISABLED"] && Vagrant.has_plugin?("vagrant-cachier")
    config.cache.scope = :box
  end
end

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd like to focus on the docker part since I simply copied the vagrant-configuration and did not change it. I'll change it in another PR.

Copy link
Member

@artem-sidorenko artem-sidorenko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rndmh3ro I added some 2cts from my side:)

@@ -23,6 +32,10 @@ platforms:
driver_config:
box: opscode-ubuntu-14.04
box_url: https://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_ubuntu-14.04_chef-provisionerless.box
- name: ubuntu-16.04
driver_config:
box: opscode-ubuntu-16.04
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

usually its better to use the bento boxes, as the opscode boxes are not maintained anymore

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd like to focus on the docker part since I simply copied the vagrant-configuration and did not change it. I'll change it in another PR.

driver_config:
box: debian-6
box_url: https://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_debian-6.0.10_chef-provisionerless.box
box: boxcutter/ol72
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are bento boxes available for oracle, I would suggest to use them as they are maintained

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd like to focus on the docker part since I simply copied the vagrant-configuration and did not change it. I'll change it in another PR.

- 'inspec exec https://github.com/dev-sec/nginx-baseline/ -t docker://$(cat ${container_id})'

notifications:
webhooks: https://galaxy.ansible.com/api/v1/notifications/
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

out of interest: what does this hook?:)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This gets used to show the build status here: https://galaxy.ansible.com/dev-sec/nginx-hardening/

.travis.yml Outdated
- 'docker exec "$(cat ${container_id})" ansible-galaxy install -r /etc/ansible/roles/ansible-nginx-hardening/requirements.yml -p /etc/ansible/roles/'

# Test role.
- 'docker exec "$(cat ${container_id})" ansible-playbook /etc/ansible/roles/ansible-nginx-hardening/default.yml'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(just asking) what is the reason of not using the kitchen here? Its somehow redundant, you have a kitchen configuration for docker, but CI runs it completely without it

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried using kitchen with travis before, but did not get it to work. Too many dependency-problems. Kitchen stills gets used locally, though.

@rndmh3ro
Copy link
Member Author

rndmh3ro commented Mar 6, 2017

Thanks for reviewing, @artem-sidorenko! Do you see anything blocking here, except for the vagrant part?

@artem-sidorenko
Copy link
Member

@rndmh3ro no:)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants