Commit 4bfa5156 authored by Stephen Seltzer's avatar Stephen Seltzer

Update of base boxes and rolse to include Ansible Facts. General cleanup.

parent 8f9f55e8
......@@ -10,7 +10,15 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# please see the online documentation at vagrantup.com.
# Every Vagrant virtual environment requires a box to build off of.
config.vm.box = "centos-6.4-32"
config.vm.box = "edu.psu/centos_base"
config.vm.box_url = "https://nexus.ci.psu.edu/repository/vagrant-boxes/centos_base.json"
# The centos-8-base box is a prebuilt box, but is not hosted in one
# of the vagrant repositories. In order to import it, you will need
# to run the following command while in the infrastructure directory:
# vagrant box add ./base-boxes/centos-8-base.box --name=centos-8-base
#config.vm.box = "centos-8-base"
# Create a forwarded port mapping which allows access to a specific port
# within the machine from a port on the host machine. In the example below,
......@@ -27,6 +35,8 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# using a specific IP.
config.vm.network "private_network", ip: "192.168.33.10", hostname: "vm"
config.ssh.insert_key = false
config.vm.provider :virtualbox do |vb|
vb.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
end
......@@ -36,7 +46,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# Enable provisioning with Ansible
config.vm.provision :ansible do |ansible|
ansible.playbook = "playbook.yml"
ansible.playbook = "playbook_psu_base_vagrant.yml"
ansible.groups = {
"vagrant" => ["default"]
}
......
......@@ -67,7 +67,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# Configure VM Ram usage
config.vm.provider :virtualbox do |vb|
vb.customize ["modifyvm", :id, "--memory", "1024"]
vb.customize ["modifyvm", :id, "--memory", "512"]
end
# Enable provisioning with a Shell script
......
......@@ -11,10 +11,8 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# Every Vagrant virtual environment requires a box to build off of.
# Every Vagrant virtual environment requires a box to build off of.
#config.vm.box = "centos-6.4-32"
config.vm.box = "edu.psu/centos_base"
# config.vm.box_url = "https://nexus.ci.psu.edu/repository/vagrant-boxes/centos_base.json"
config.vm.box_url = "file:///home/stephen/git/infrastructure/base-boxes/base-centos/centos_base.json"
config.vm.box_url = "https://nexus.ci.psu.edu/repository/vagrant-boxes/centos_base.json"
# Disable automatic box update checking. If you disable this, then
# boxes will only be checked for updates when the user runs
......@@ -71,7 +69,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# Configure VM Ram usage
config.vm.provider :virtualbox do |vb|
vb.customize ["modifyvm", :id, "--memory", "1024"]
vb.customize ["modifyvm", :id, "--memory", "512"]
end
# Enable provisioning with a Shell script
......
......@@ -12,6 +12,18 @@
"checksum": "a080756314d75f4f8d7be82613d076846afe5233"
}
]
},
{
"version": "1.0.1",
"description": "Adds facts file. Reduces memory to 512 by default.",
"providers": [
{
"name": "virtualbox",
"url": "https://nexus.ci.psu.edu/repository/vagrant-boxes/base-wildfly10/base-wildfly10_1_0_1.tar.gz",
"checksum_type": "sha1",
"checksum": "84fb2d38152bd802e09429591395a45a0514ff8e"
}
]
}
]
}
\ No newline at end of file
......@@ -9,4 +9,14 @@
- { role: mock_web_access }
- { role: properties_service }
- { role: swagger_ui }
- { role: deploy_prep }
tasks:
- name: update build_vars with the list of roles executed.
lineinfile: "dest='/etc/ansible/facts.d/build_vars.fact' create=true regexp='[roles_provisioned]' line='[roles_provisioned]'"
- lineinfile: dest='/etc/ansible/facts.d/build_vars.fact' regexp=java8 line='java8=base-wildfly-10'
- lineinfile: dest='/etc/ansible/facts.d/build_vars.fact' regexp=postgresql line='postgresql=base-wildfly-10'
- lineinfile: dest='/etc/ansible/facts.d/build_vars.fact' regexp=wildfly10 line='wildfly10=base-wildfly-10'
- lineinfile: dest='/etc/ansible/facts.d/build_vars.fact' regexp=mock_web_access line='mock_web_access=base-wildfly-10'
- lineinfile: dest='/etc/ansible/facts.d/build_vars.fact' regexp=properties_service line='properties_service=base-wildfly-10'
- lineinfile: dest='/etc/ansible/facts.d/build_vars.fact' regexp=swagger_ui line='swagger_ui=base-wildfly-10'
\ No newline at end of file
......@@ -10,7 +10,8 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# please see the online documentation at vagrantup.com.
# Every Vagrant virtual environment requires a box to build off of.
config.vm.box = "centos-6.4-32"
config.vm.box = "edu.psu/centos_base"
config.vm.box_url = "https://nexus.ci.psu.edu/repository/vagrant-boxes/centos_base.json"
# Disable automatic box update checking. If you disable this, then
# boxes will only be checked for updates when the user runs
......@@ -27,7 +28,9 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# Create a private network, which allows host-only access to the machine
# using a specific IP.
config.vm.network "private_network", ip: "192.168.33.101"
config.vm.network "private_network", ip: "192.168.33.10", hostname: "vm"
config.ssh.insert_key = false
# Create a public network, which generally matched to bridged network.
# Bridged networks make the machine appear as another physical device on
......@@ -65,7 +68,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# Configure VM Ram usage
config.vm.provider :virtualbox do |vb|
vb.customize ["modifyvm", :id, "--memory", "1024"]
vb.customize ["modifyvm", :id, "--memory", "512"]
end
# Enable provisioning with a Shell script
......
{
"name": "edu.psu/base-wildfly9",
"description": "CentOS 6.x 64-bit with Wildfly9, Java 8",
"versions": [
{
"version": "1.0.0",
"providers": [
{
"name": "virtualbox",
"url": "https://nexus.ci.psu.edu/repository/vagrant-boxes/base-wildfly9/base-wildfly9_1_0_0.tar.gz",
"checksum_type": "sha1",
"checksum": "f8af04d9a52aa75bc24f250629432b590fca185d"
}
]
},
{
"version": "1.0.1",
"description": "Adds facts file. Reduces memory to 512 by default.",
"providers": [
{
"name": "virtualbox",
"url": "https://nexus.ci.psu.edu/repository/vagrant-boxes/base-wildfly9/base-wildfly9_1_0_1.tar.gz",
"checksum_type": "sha1",
"checksum": "da69cf1e001f69a5e04c254ee3d68b375a5e8326"
}
]
}
]
}
---
# file: security_service.yml
# file: playbook.yml
- hosts: vagrant
sudo: yes
roles:
- { role: base }
- { role: java8 }
- { role: postgresql }
- { role: wildfly9 }
- { role: mock_web_access }
- { role: properties_service }
- { role: swagger_ui }
- { role: deploy_prep }
tasks:
- name: update build_vars with the list of roles executed.
lineinfile: "dest='/etc/ansible/facts.d/build_vars.fact' create=true regexp='[roles_provisioned]' line='[roles_provisioned]'"
- lineinfile: dest='/etc/ansible/facts.d/build_vars.fact' regexp=java8 line='java8=base-wildfly-9'
- lineinfile: dest='/etc/ansible/facts.d/build_vars.fact' regexp=postgresql line='postgresql=base-wildfly-9'
- lineinfile: dest='/etc/ansible/facts.d/build_vars.fact' regexp=wildfly9 line='wildfly9=base-wildfly-9'
- lineinfile: dest='/etc/ansible/facts.d/build_vars.fact' regexp=mock_web_access line='mock_web_access=base-wildfly-9'
- lineinfile: dest='/etc/ansible/facts.d/build_vars.fact' regexp=properties_service line='properties_service=base-wildfly-9'
- lineinfile: dest='/etc/ansible/facts.d/build_vars.fact' regexp=swagger_ui line='swagger_ui=base-wildfly-9'
---
# file: roles/deploy_prep/tasks/main.yml
- name: remove eth1 reference from
lineinfile: 'dest=/etc/udev/rules.d/70-persistent-net.rules create=false state=absent regexp=NAME=\"eth1\"'
- name: remove ifcfg-eth1 file
file: path='/etc/sysconfig/network-scripts/ifcfg-eth1' state=absent
......@@ -105,3 +105,23 @@
deploy_path={{ wildfly_deploy_directory }} deployment=postgresql92-jdbc.jar
when: db_postgresql_installed is defined and db_postgresql_installed == true
- name: create facts file
lineinfile: "dest='/etc/ansible/facts.d/build_vars.fact' create=true regexp='[wildfly]' line='[wildfly]'"
- lineinfile: "dest='/etc/ansible/facts.d/build_vars.fact' regexp='wildfly_download_url' line='wildfly_download_url={{ wildfly_download_url }}'"
- lineinfile: "dest='/etc/ansible/facts.d/build_vars.fact' regexp='wildfly_version' line='wildfly_version={{ wildfly_version }}'"
- lineinfile: "dest='/etc/ansible/facts.d/build_vars.fact' regexp='wildfly_name' line='wildfly_name={{ wildfly_name }}'"
- lineinfile: "dest='/etc/ansible/facts.d/build_vars.fact' regexp='wildfly_archive_name' line='wildfly_archive_name={{ wildfly_archive_name }}'"
- lineinfile: "dest='/etc/ansible/facts.d/build_vars.fact' regexp='wildfly_archive_url' line='wildfly_archive_url={{ wildfly_archive_url }}'"
- lineinfile: "dest='/etc/ansible/facts.d/build_vars.fact' regexp='wildfly_user' line='wildfly_user={{ wildfly_user }}'"
- lineinfile: "dest='/etc/ansible/facts.d/build_vars.fact' regexp='wildfly_group' line='wildfly_group={{ wildfly_group }}'"
- lineinfile: "dest='/etc/ansible/facts.d/build_vars.fact' regexp='wildfly_password' line='wildfly_password={{ wildfly_password }}'"
- lineinfile: "dest='/etc/ansible/facts.d/build_vars.fact' regexp='wildfly_service_name' line='wildfly_service_name={{ wildfly_service_name }}'"
- lineinfile: "dest='/etc/ansible/facts.d/build_vars.fact' regexp='wildfly_profile' line='wildfly_profile={{ wildfly_profile }}'"
- lineinfile: "dest='/etc/ansible/facts.d/build_vars.fact' regexp='wildfly_inst_directory' line='wildfly_inst_directory={{ wildfly_inst_directory }}'"
- lineinfile: "dest='/etc/ansible/facts.d/build_vars.fact' regexp='wildfly_home_directory' line='wildfly_home_directory={{ wildfly_home_directory }}'"
- lineinfile: "dest='/etc/ansible/facts.d/build_vars.fact' regexp='wildfly_conf_directory' line='wildfly_conf_directory={{ wildfly_conf_directory }}'"
- lineinfile: "dest='/etc/ansible/facts.d/build_vars.fact' regexp='wildfly_deploy_directory' line='wildfly_deploy_directory={{ wildfly_deploy_directory }}'"
- lineinfile: "dest='/etc/ansible/facts.d/build_vars.fact' regexp='wildfly_prog_directory' line='wildfly_prog_directory={{ wildfly_prog_directory }}'"
- lineinfile: "dest='/etc/ansible/facts.d/build_vars.fact' regexp='wildfly_work_directory' line='wildfly_work_directory={{ wildfly_work_directory }}'"
- lineinfile: "dest='/etc/ansible/facts.d/build_vars.fact' regexp='wildfly_log_directory' line='wildfly_log_directory={{ wildfly_log_directory }}'"
- lineinfile: "dest='/etc/ansible/facts.d/build_vars.fact' regexp='wildfly_pid_directory' line='wildfly_pid_directory={{ wildfly_pid_directory }}'"
......@@ -61,9 +61,6 @@
- name: configure chkconfig to run the wildfly startup script at the correct run-levels
shell: chkconfig --level 2345 wildfly on creates=/etc/rc2.d/S80wildfly
#- name: make sure wildfly is stopped
# service: name="{{ wildfly_service_name }}" state="stopped"
- name: save a copy of the wildfly distribution's standalone.xml
shell: mv standalone.xml standalone.xml.dist
chdir="{{ wildfly_conf_directory }}" creates=standalone.xml.dist
......@@ -91,16 +88,6 @@
- wildfly-slsb-pool.cli
- psu-security-domain.cli
#- name: make the jboss-as interfaces listen on all addresses
# lineinfile: dest={{ wildfly_conf_directory }}/standalone.xml
# regexp="{{ item }}" line=" <any-address />"
# with_items:
# - "<inet-address value=.*jboss.bind.address.management:|any-address"
# - "<inet-address value=.*jboss.bind.address:|any-address"
# - "<inet-address value=.*jboss.bind.address.unsecure:|any-address"
# notify:
# - restart wildfly
- name: add an admin user for wildfly's web console
lineinfile: dest="{{ wildfly_conf_directory }}/mgmt-users.properties"
regexp="^vadmin=" insertafter="^#admin=" line="vadmin=d745a3c00ee100da10ad80d86e6f2dec"
......@@ -109,4 +96,25 @@
jboss: src=/usr/share/java/postgresql92-jdbc.jar state=present
deploy_path={{ wildfly_deploy_directory }} deployment=postgresql92-jdbc.jar
when: db_postgresql_installed is defined and db_postgresql_installed == true
- name: create facts file
lineinfile: "dest='/etc/ansible/facts.d/build_vars.fact' create=true regexp='[wildfly]' line='[wildfly]'"
- lineinfile: "dest='/etc/ansible/facts.d/build_vars.fact' regexp='wildfly_download_url' line='wildfly_download_url={{ wildfly_download_url }}'"
- lineinfile: "dest='/etc/ansible/facts.d/build_vars.fact' regexp='wildfly_version' line='wildfly_version={{ wildfly_version }}'"
- lineinfile: "dest='/etc/ansible/facts.d/build_vars.fact' regexp='wildfly_name' line='wildfly_name={{ wildfly_name }}'"
- lineinfile: "dest='/etc/ansible/facts.d/build_vars.fact' regexp='wildfly_archive_name' line='wildfly_archive_name={{ wildfly_archive_name }}'"
- lineinfile: "dest='/etc/ansible/facts.d/build_vars.fact' regexp='wildfly_archive_url' line='wildfly_archive_url={{ wildfly_archive_url }}'"
- lineinfile: "dest='/etc/ansible/facts.d/build_vars.fact' regexp='wildfly_user' line='wildfly_user={{ wildfly_user }}'"
- lineinfile: "dest='/etc/ansible/facts.d/build_vars.fact' regexp='wildfly_group' line='wildfly_group={{ wildfly_group }}'"
- lineinfile: "dest='/etc/ansible/facts.d/build_vars.fact' regexp='wildfly_password' line='wildfly_password={{ wildfly_password }}'"
- lineinfile: "dest='/etc/ansible/facts.d/build_vars.fact' regexp='wildfly_service_name' line='wildfly_service_name={{ wildfly_service_name }}'"
- lineinfile: "dest='/etc/ansible/facts.d/build_vars.fact' regexp='wildfly_profile' line='wildfly_profile={{ wildfly_profile }}'"
- lineinfile: "dest='/etc/ansible/facts.d/build_vars.fact' regexp='wildfly_inst_directory' line='wildfly_inst_directory={{ wildfly_inst_directory }}'"
- lineinfile: "dest='/etc/ansible/facts.d/build_vars.fact' regexp='wildfly_home_directory' line='wildfly_home_directory={{ wildfly_home_directory }}'"
- lineinfile: "dest='/etc/ansible/facts.d/build_vars.fact' regexp='wildfly_conf_directory' line='wildfly_conf_directory={{ wildfly_conf_directory }}'"
- lineinfile: "dest='/etc/ansible/facts.d/build_vars.fact' regexp='wildfly_deploy_directory' line='wildfly_deploy_directory={{ wildfly_deploy_directory }}'"
- lineinfile: "dest='/etc/ansible/facts.d/build_vars.fact' regexp='wildfly_prog_directory' line='wildfly_prog_directory={{ wildfly_prog_directory }}'"
- lineinfile: "dest='/etc/ansible/facts.d/build_vars.fact' regexp='wildfly_work_directory' line='wildfly_work_directory={{ wildfly_work_directory }}'"
- lineinfile: "dest='/etc/ansible/facts.d/build_vars.fact' regexp='wildfly_log_directory' line='wildfly_log_directory={{ wildfly_log_directory }}'"
- lineinfile: "dest='/etc/ansible/facts.d/build_vars.fact' regexp='wildfly_pid_directory' line='wildfly_pid_directory={{ wildfly_pid_directory }}'"
......@@ -56,9 +56,6 @@
- name: configure chkconfig to run the wildfly startup script at the correct run-levels
shell: chkconfig --level 2345 wildfly on creates=/etc/rc2.d/S80wildfly
#- name: make sure wildfly is stopped
# service: name="{{ wildfly_service_name }}" state="stopped"
- name: save a copy of the wildfly distribution's standalone.xml
shell: mv standalone.xml standalone.xml.dist
chdir="{{ wildfly_conf_directory }}" creates=standalone.xml.dist
......@@ -86,16 +83,6 @@
- wildfly-slsb-pool.cli
- psu-security-domain.cli
#- name: make the jboss-as interfaces listen on all addresses
# lineinfile: dest={{ wildfly_conf_directory }}/standalone.xml
# regexp="{{ item }}" line=" <any-address />"
# with_items:
# - "<inet-address value=.*jboss.bind.address.management:|any-address"
# - "<inet-address value=.*jboss.bind.address:|any-address"
# - "<inet-address value=.*jboss.bind.address.unsecure:|any-address"
# notify:
# - restart wildfly
- name: add an admin user for wildfly's web console
lineinfile: dest="{{ wildfly_conf_directory }}/mgmt-users.properties"
regexp="^vadmin=" insertafter="^#admin=" line="vadmin=d745a3c00ee100da10ad80d86e6f2dec"
......@@ -105,3 +92,24 @@
deploy_path={{ wildfly_deploy_directory }} deployment=postgresql92-jdbc.jar
when: db_postgresql_installed is defined and db_postgresql_installed == true
- name: create facts file
lineinfile: "dest='/etc/ansible/facts.d/build_vars.fact' create=true regexp='[wildfly]' line='[wildfly]'"
- lineinfile: "dest='/etc/ansible/facts.d/build_vars.fact' regexp='wildfly_download_url' line='wildfly_download_url={{ wildfly_download_url }}'"
- lineinfile: "dest='/etc/ansible/facts.d/build_vars.fact' regexp='wildfly_version' line='wildfly_version={{ wildfly_version }}'"
- lineinfile: "dest='/etc/ansible/facts.d/build_vars.fact' regexp='wildfly_name' line='wildfly_name={{ wildfly_name }}'"
- lineinfile: "dest='/etc/ansible/facts.d/build_vars.fact' regexp='wildfly_archive_name' line='wildfly_archive_name={{ wildfly_archive_name }}'"
- lineinfile: "dest='/etc/ansible/facts.d/build_vars.fact' regexp='wildfly_archive_url' line='wildfly_archive_url={{ wildfly_archive_url }}'"
- lineinfile: "dest='/etc/ansible/facts.d/build_vars.fact' regexp='wildfly_user' line='wildfly_user={{ wildfly_user }}'"
- lineinfile: "dest='/etc/ansible/facts.d/build_vars.fact' regexp='wildfly_group' line='wildfly_group={{ wildfly_group }}'"
- lineinfile: "dest='/etc/ansible/facts.d/build_vars.fact' regexp='wildfly_password' line='wildfly_password={{ wildfly_password }}'"
- lineinfile: "dest='/etc/ansible/facts.d/build_vars.fact' regexp='wildfly_service_name' line='wildfly_service_name={{ wildfly_service_name }}'"
- lineinfile: "dest='/etc/ansible/facts.d/build_vars.fact' regexp='wildfly_profile' line='wildfly_profile={{ wildfly_profile }}'"
- lineinfile: "dest='/etc/ansible/facts.d/build_vars.fact' regexp='wildfly_inst_directory' line='wildfly_inst_directory={{ wildfly_inst_directory }}'"
- lineinfile: "dest='/etc/ansible/facts.d/build_vars.fact' regexp='wildfly_home_directory' line='wildfly_home_directory={{ wildfly_home_directory }}'"
- lineinfile: "dest='/etc/ansible/facts.d/build_vars.fact' regexp='wildfly_conf_directory' line='wildfly_conf_directory={{ wildfly_conf_directory }}'"
- lineinfile: "dest='/etc/ansible/facts.d/build_vars.fact' regexp='wildfly_deploy_directory' line='wildfly_deploy_directory={{ wildfly_deploy_directory }}'"
- lineinfile: "dest='/etc/ansible/facts.d/build_vars.fact' regexp='wildfly_prog_directory' line='wildfly_prog_directory={{ wildfly_prog_directory }}'"
- lineinfile: "dest='/etc/ansible/facts.d/build_vars.fact' regexp='wildfly_work_directory' line='wildfly_work_directory={{ wildfly_work_directory }}'"
- lineinfile: "dest='/etc/ansible/facts.d/build_vars.fact' regexp='wildfly_log_directory' line='wildfly_log_directory={{ wildfly_log_directory }}'"
- lineinfile: "dest='/etc/ansible/facts.d/build_vars.fact' regexp='wildfly_pid_directory' line='wildfly_pid_directory={{ wildfly_pid_directory }}'"
---
# file: test.yml
- hosts: vagrant
sudo: yes
roles:
- base
- java7
- postgresql
- jboss
# - test
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment