To get this to work we will use vagrant port forwarding by adding the following to our Vagrantfile. If we try an connect from the host to the VM, it wont work. Oracle Database 11g Express Edition Release 11.2.0.2.0 - 64bit Production Vagrant port fowarding - connect from your host Welcome to your Vagrant-built virtual ~]$ sqlplus system/manager Release 11.2.0.2.0 Production on Sun Nov 10 12:37:23 2013Ĭopyright (c) 1982, 2011, Oracle. We can now test that oracle works from inside the VM: $ vagrant up config.vm.provision "ansible" do |ansible|Īaybook = "provisioning/oracle-xe.yml" We also set the ansible verbose setting to extra, so we can see what is going on. We need to tell Vagrant to use the ansible playbook, by adding the following to the Vagrantfile. Then we setup the vagrant users environmentĪdd the following to oracle/xe.rsp ORACLE_HTTP_PORT=8080.We need to pass the oracle configure script a response file xe.rsp so it does not wait for input.Shell: /bin/echo 'source /u01/app/oracle/product/11.2.0/xe/bin/oracle_env.sh' > /home/vagrant/.bash_profile Shell: /etc/init.d/oracle-xe configure responseFile=/vagrant/oracle/xe.rsp Then we configure oracle and the vagrant user environment - name: configure oracle You will need this or to ignore errors as the oracle installation returns an error if it is already installed.creates= defines a directory that is created when the task runs, if the box is reloaded and the directory exists, the task will be skipped.The next thing we need to include in our playbook, is unzipping and installing oracle: - name: unzip oracle rpmĬommand: /usr/bin/unzip -q /vagrant/oracle/oracle*.rpm.zip -d /vagrant/oracle creates=/vagrant/oracle/Disk1 Save the zip file to the oracle directory. Unfortunately due to oracle licensing, you will need to accept the license agreement and download the oracle rpm from: For the name: you can use anything that describes the task.with_items lets you specify multiple items and ansible will loop through all of the items on the list and run yum for each package.The yum command can be used to install packages, specifying them with pkg=. We then have the list of tasks we need to run.Then we tell ansible to use sudo to run the commands.hosts: specifies which hosts to run the playbook on.name: ensure packages required are installed Lets ensure our playbook caters for these:. $ mkdir provisioningīefore installing oracle, a few base packages are needed. You can read more at: īefore we start with our oracle playbook, we need to create a few directories. All the steps are described in a yml file, with specific keywords for each task. Vagrantfile abd.txt Creating the playbookĪnsible has playbooks, which basically describe all the steps ansible needs to execute to get your system to the required state. You will also notice, that /vagrant folder is a shared folder with your host machine, the root of the directory where the Vagrantfile is stored. We can add other customizations, like increase the memory size by adding this to the Vagrantfile config.vm.provider :virtualbox do |vb| Great it works, we have a basic CentOS 6.4 Minimal install working, this is exactly like the box we created with veewee. Welcome to your Vagrant-built virtual machine. Preparing network interfaces based on configuration. Clearing any previously set network interfaces. Clearing any previously set forwarded ports. Matching MAC address for NAT networking. `` for more information on using Vagrant.Įdit the Vagrantfile and change config.vm.box to: config.vm.box = "centos-64-x86_64"īringing machine 'default' up with 'virtualbox' provider. The comments in the Vagrantfile as well as documentation on Ready to `vagrant up` your first virtual environment! Please read vagrant-centos-oracleĪ `Vagrantfile` has been placed in this directory. Vagrant uses a Vagrantfile to describe the type of machine you would like to build, and the file should be stored in the root directory of your source code. Now that we have the CentOS 6.4 base box, we can add it to vagrant with: $ vagrant box list Tasks are described in yml, which can be written and read even by non programmers. It differs from Chef and Puppet, as it requires nothing to be installed on the server, it uses ssh. The source code is available at: About AnsibleĪnsible is an IT orchestration engine/configuration management system, that lets you easily describe how you would like your servers to look and then automate it. If you have not already, read the first tip on creating a vagrant CentOs base box This tip will cover installing oracle xe on CentOS 6.4 using Vagrant and Ansible.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |