Skip to content
This repository was archived by the owner on Feb 13, 2023. It is now read-only.

Commit 76d961e

Browse files
authored
Merge pull request #815 from geerlingguy/roles-in-vm
Include roles with Drupal VM codebase
2 parents ca3a7b6 + 6e91025 commit 76d961e

File tree

532 files changed

+13039
-14
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

532 files changed

+13039
-14
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
.vagrant/
55
.bundle/
66
*.retry
7+
.galaxy_install_info
78
vagrant_ansible_inventory_default
89
local.config.yml
910
config.yml
@@ -12,5 +13,4 @@ Vagrantfile.local
1213
examples/prod/inventory
1314
examples/prod/bootstrap/vars.yml
1415
scripts/
15-
roles/
1616
drupal/

.travis.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,6 @@ script:
4949
# Setup directories.
5050
- 'sudo docker exec "$(cat ${container_id})" mkdir -p ${DRUPALVM_DIR}/drupal'
5151

52-
# Install dependencies.
53-
- 'sudo docker exec "$(cat ${container_id})" ansible-galaxy install -r ${DRUPALVM_DIR}/provisioning/requirements.yml'
54-
5552
# Setup config directory.
5653
- '[[ ! -z "${config_dir}" ]] && sudo docker exec "$(cat ${container_id})" mkdir -p ${config_dir} || true'
5754

@@ -64,7 +61,7 @@ script:
6461
- '[[ ! -z "${local_config}" ]] && sudo docker exec "$(cat ${container_id})" bash -c "cp ${DRUPALVM_DIR}/${local_config} ${config_dir:-$DRUPALVM_DIR}/local.config.yml" || true'
6562

6663
# Vagrantfile syntax check
67-
- 'rubocop --except LineLength,Eval,MutableConstant'
64+
- 'rubocop ./Vagrantfile --except LineLength,Eval,MutableConstant'
6865

6966
# Ansible syntax check.
7067
- 'sudo docker exec --tty "$(cat ${container_id})" env TERM=xterm ansible-playbook ${DRUPALVM_DIR}/provisioning/playbook.yml --syntax-check'

Vagrantfile

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,6 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
122122
if which('ansible-playbook')
123123
config.vm.provision 'ansible' do |ansible|
124124
ansible.playbook = "#{host_drupalvm_dir}/provisioning/playbook.yml"
125-
ansible.galaxy_role_file = "#{host_drupalvm_dir}/provisioning/requirements.yml"
126125
ansible.extra_vars = {
127126
config_dir: host_config_dir
128127
}
@@ -137,7 +136,6 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
137136
# else
138137
# config.vm.provision "ansible_local" do |ansible|
139138
# ansible.playbook = "#{guest_drupalvm_dir}/provisioning/playbook.yml"
140-
# ansible.galaxy_role_file = "#{guest_drupalvm_dir}/provisioning/requirements.yml"
141139
# ansible.extra_vars = {
142140
# config_dir: guest_config_dir
143141
# }

docs/other/overriding-configurations.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,6 @@ config.vm.provider :virtualbox do |v|
4545
# Cap the host CPU execution at 50% usage.
4646
v.customize ["modifyvm", :id, "--cpuexecutioncap", "50"]
4747
end
48-
49-
# Disable the galaxy role re-installation during provisions.
50-
config.vm.provisioners[0].config.galaxy_role_file = nil
5148
```
5249

5350
### Example: Using the `vagrant-aws` provider

docs/other/php-56.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
Drupal VM defaults to PHP 7, but you can install and use 5.6 if you need to maximize compatibility with older Drupal 6 and 7 sites.
22

3-
_Note: If you have Ansible installed on your host machine, make sure you're running the latest version of all Ansible role dependencies by running `ansible-galaxy install -r provisioning/requirements.yml --force` inside the root Drupal VM project folder._
4-
53
## Ubuntu 16.04
64

75
Ubuntu 16.04 Xenial defaults to PHP 7.0 in it's system packages. No older versions of PHP will be supported if using this base box.

provisioning/JJG-Ansible-Windows/windows.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@ if ! command -v ansible >/dev/null; then
7171
fi
7272

7373
# Install requirements.
74-
echo "Installing Ansible roles from requirements file, if available."
75-
find "$PLAYBOOK_DIR" \( -name "requirements.yml" -o -name "requirements.txt" \) -exec sudo ansible-galaxy install --force --ignore-errors -r {} \;
74+
#echo "Installing Ansible roles from requirements file, if available."
75+
#find "$PLAYBOOK_DIR" \( -name "requirements.yml" -o -name "requirements.txt" \) -exec sudo ansible-galaxy install --force --ignore-errors -r {} \;
7676

7777
# Run the playbook.
7878
echo "Running Ansible provisioner defined in Vagrantfile."

provisioning/README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Drupal VM - Ansible Provisioning
2+
3+
Drupal VM uses the Ansible provisioner to build all the software that runs and supplements Drupal sites.
4+
5+
The Ansible configuration uses a variety of open source community-maintained Ansible Roles that are hosted on Ansible Galaxy, but Drupal VM includes the roles in the codebase for efficiency's sake.
6+
7+
**You should NOT make any manual changes to the roles in the `roles` directory**, but rather, contribute to the upstream roles corresponding to the role's folder name (e.g. for issues with the `geerlingguy.apache` role, see the [`geerlingguy.apache`](https://galaxy.ansible.com/geerlingguy/apache/) role page on Ansible Galaxy, and the role's [issue tracker on GitHub](https://github.com/geerlingguy/ansible-role-apache/issues)).
8+
9+
## Adding and Updating Galaxy roles
10+
11+
From time to time, third party roles need to be added or updated to enable new Drupal VM functionality or fix bugs. To update a role (e.g. `geerlingguy.apache`), find the role's `version` setting inside `requirements.yml`, bump the version to the required or latest version of the role, then run the following command _in the same directory as this README file_:
12+
13+
$ ansible-galaxy install -r requirements.yml --force
14+
15+
Then commit the updated `requirements.yml` file and the new and updated files within the `roles` directory in a new PR to the Drupal VM project.

provisioning/ansible.cfg

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[defaults]
2+
roles_path = ./roles
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# OS generated files #
2+
######################
3+
.DS_Store
4+
.DS_Store?
5+
._*
6+
.Spotlight-V100
7+
.Trashes
8+
Icon?
9+
ehthumbs.db
10+
Thumbs.db
11+
12+
# IDE files #
13+
#################
14+
/.settings
15+
/.buildpath
16+
/.project
17+
/nbproject
18+
*.komodoproject
19+
*.kpf
20+
/.idea
21+
22+
# Other files #
23+
###############
24+
!empty
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
---
2+
language: python
3+
python: "2.7"
4+
5+
env:
6+
- ANSIBLE_VERSION=1.6
7+
- ANSIBLE_VERSION=1.7
8+
- ANSIBLE_VERSION=1.8
9+
10+
before_install:
11+
- sudo apt-get update -qq
12+
13+
install:
14+
# Install Ansible.
15+
- pip install ansible==$ANSIBLE_VERSION
16+
17+
# Add ansible.cfg to pick up roles path.
18+
- "printf '[defaults]\\nroles_path = ../' > ansible.cfg"
19+
20+
script:
21+
# Check the role/playbook's syntax.
22+
- "ansible-playbook -i tests/inventory tests/test.yml --syntax-check"
23+
24+
# Run the role/playbook with ansible-playbook.
25+
- "ansible-playbook -i tests/inventory tests/test.yml --connection=local --sudo -vvvv"
26+
27+
# Run the role/playbook again, checking to make sure it's idempotent.
28+
- >
29+
ansible-playbook -i tests/inventory tests/test.yml --connection=local --sudo
30+
| grep -q 'changed=0.*failed=0'
31+
&& (echo 'Idempotence test: pass' && exit 0)
32+
|| (echo 'Idempotence test: fail' && exit 1)
33+
34+
notifications:
35+
email: false

0 commit comments

Comments
 (0)