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

Commit

Permalink
Issue #1356: Create an official drupal-vm image on Docker Hub.
Browse files Browse the repository at this point in the history
  • Loading branch information
geerlingguy committed May 13, 2017
1 parent 8f605ea commit b13fcea
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 5 deletions.
12 changes: 12 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM geerlingguy/docker-debian8-ansible:latest
MAINTAINER Jeff Geerling

# Copy provisioning directory into VM.
COPY ./ /etc/ansible/drupal-vm

# Provision Drupal VM inside Docker.
RUN ANSIBLE_FORCE_COLOR=true \
ansible-playbook /etc/ansible/drupal-vm/provisioning/playbook.yml \
--extra-vars="hostname_fqdn=false firewall_enabled=false"

EXPOSE 22 80 81 443 8025
5 changes: 3 additions & 2 deletions default.config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -220,10 +220,11 @@ extra_packages:
- sqlite

# You can configure almost anything else on the server in the rest of this file.
extra_security_enabled: false

drush_version: "8.1.10"

extra_security_enabled: false

firewall_enabled: true
firewall_allowed_tcp_ports:
- "22"
- "25"
Expand Down
2 changes: 1 addition & 1 deletion provisioning/playbook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
# Essential roles.
- { role: geerlingguy.repo-remi, when: ansible_os_family == 'RedHat', tags: ['webserver', 'php'] }
- { role: drupalvm.hostname }
- { role: geerlingguy.firewall }
- { role: geerlingguy.firewall, when: firewall_enabled }
- { role: geerlingguy.git }
- { role: geerlingguy.postfix }
- { role: geerlingguy.apache, when: drupalvm_webserver == 'apache', tags: ['webserver']}
Expand Down
2 changes: 1 addition & 1 deletion provisioning/roles/drupalvm.hostname/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Available variables are listed below:
hostname_fqdn: "{{ inventory_hostname }}"
```
The fully qualified domain name.
The fully qualified domain name. If left blank, the `hostname` command will not be run (this can be useful if running the role within a Docker container).

```yaml
hostname_short: "{{ hostname_fqdn|regex_replace('^([^.]+).*$', '\\1') }}"
Expand Down
3 changes: 2 additions & 1 deletion provisioning/roles/drupalvm.hostname/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
dest: /etc/hostname
unsafe_writes: "{{ hostname_unsafe_writes }}"
register: set_hostname
when: hostname_fqdn

- name: Set the hostname for current session.
shell: hostname --file /etc/hostname
when: set_hostname.changed
when: hostname_fqdn and set_hostname.changed

0 comments on commit b13fcea

Please sign in to comment.