Skip to content

Commit a00e5c5

Browse files
committed
Fixes geerlingguy#58: Add README and Vagrantfile to nodejs-role example.
1 parent 65ce5fd commit a00e5c5

File tree

2 files changed

+35
-0
lines changed

2 files changed

+35
-0
lines changed

nodejs-role/README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Node.js Role Example
2+
3+
This example is an extension of the [Node.js example](../nodejs/README.md). Please read through the directions in that example's README to get this example running locally through Vagrant.
4+
5+
The primary difference in this example (as explained in [Ansible for DevOps](https://www.ansiblefordevops.com/)) is that the actual _installation of Node.js_ is done in a new `nodejs` role.
6+
7+
After running `vagrant up`, perform the following steps to access the app via a hostname:
8+
9+
1. [Edit your hosts file](http://www.rackspace.com/knowledge_center/article/how-do-i-modify-my-hosts-file), adding the line `192.168.55.56 nodejs-role.dev` so you can connect to the VM.
10+
2. Open your browser and access [http://nodejs-role.dev/](http://nodejs-role.dev/).
11+
12+
## About the Author
13+
14+
This project was created by [Jeff Geerling](https://www.jeffgeerling.com/) as an example for [Ansible for DevOps](https://www.ansiblefordevops.com/).

nodejs-role/Vagrantfile

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# -*- mode: ruby -*-
2+
# vi: set ft=ruby :
3+
4+
VAGRANTFILE_API_VERSION = "2"
5+
6+
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
7+
config.vm.box = "geerlingguy/centos7"
8+
config.vm.network :private_network, ip: "192.168.55.56"
9+
config.ssh.insert_key = false
10+
config.vm.synced_folder ".", "/vagrant", disabled: true
11+
12+
config.vm.provider :virtualbox do |v|
13+
v.memory = 256
14+
end
15+
16+
# Ansible provisioner.
17+
config.vm.provision :ansible do |ansible|
18+
ansible.playbook = "playbook.yml"
19+
ansible.sudo = true
20+
end
21+
end

0 commit comments

Comments
 (0)