Skip to content
This repository has been archived by the owner on Jun 29, 2022. It is now read-only.

Commit

Permalink
Merge pull request #183 from /issues/122-part-1
Browse files Browse the repository at this point in the history
Add test setup for become-with-password
  • Loading branch information
noahl committed Aug 15, 2017
2 parents 97529ac + 70166d2 commit 950c6ac
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 13 deletions.
35 changes: 22 additions & 13 deletions Vagrantfile
Expand Up @@ -3,8 +3,8 @@ VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "rhel-server-7-1"

# Define a test box to be scanned during tests
config.vm.define "test_1" do |test_1|
# Define a test box to be scanned during tests
config.vm.define "test_1" do |test_1|
test_1.vm.network "private_network", ip: "192.168.50.10"

test_1.vm.provision "ansible" do |ansible|
Expand All @@ -14,19 +14,28 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|

# Define a test box to be scanned during tests
config.vm.define "test_2" do |test_2|
test_2.vm.network "private_network", ip: "192.168.50.11"
test_2.vm.network "private_network", ip: "192.168.50.11"

test_2.vm.provision "ansible" do |ansible|
ansible.playbook = "vagrant/setup-test-vms.yml"
end
end

# Define a test box to be scanned during tests
config.vm.define "test_3" do |test_3|
test_3.vm.network "private_network", ip: "192.168.50.12"

test_2.vm.provision "ansible" do |ansible|
ansible.playbook = "vagrant/setup-test-vms.yml"
end
end
test_3.vm.provision "ansible" do |ansible|
ansible.playbook = "vagrant/setup-test-vms.yml"
end
end

# Define a test box to be scanned during tests
config.vm.define "test_3" do |test_3|
test_3.vm.network "private_network", ip: "192.168.50.12"
# A test box that requires a password for sudo
config.vm.define "askpass" do |test_3|
test_3.vm.network "private_network", ip: "192.168.50.13"

test_3.vm.provision "ansible" do |ansible|
ansible.playbook = "vagrant/setup-test-vms.yml"
end
test_3.vm.provision "ansible" do |ansible|
ansible.playbook = "vagrant/setup-test-vms.yml"
end
end
end
10 changes: 10 additions & 0 deletions vagrant/setup-test-vms.yml
Expand Up @@ -7,3 +7,13 @@
- hosts: test_2
roles:
- jboss-standalone

- hosts: askpass
tasks:
- user:
name: askpass
state: present
groups: wheel
# Crypted version of "password"
password: $6$ZBtzwTi5YgUbr1cT$jVTtaH6lVVTndZJLHqcWtZoxPS0Siz/ms8bOKA/F/r1Np0zeptDERYIfbmRN0dLbu9Z7S./bIGzGR9nUXl59W/
become: yes

0 comments on commit 950c6ac

Please sign in to comment.