Add all files needed to bring up VM and run agaric.com locally
This commit is contained in:
parent
52c8b60bac
commit
4d2bc0ee24
742 changed files with 24037 additions and 0 deletions
47
box/provisioning/roles/drupalvm.hostname/README.md
Normal file
47
box/provisioning/roles/drupalvm.hostname/README.md
Normal file
|
@ -0,0 +1,47 @@
|
|||
# Drupal VM hostname Role
|
||||
|
||||
This role is a shim to set the hostname and FQDN of Drupal VM.
|
||||
|
||||
## Requirements
|
||||
|
||||
This role is meant to be run in Drupal VM. Use outside of Drupal VM will likely result in weird things happening.
|
||||
|
||||
## Role Variables
|
||||
|
||||
Available variables are listed below:
|
||||
|
||||
```yaml
|
||||
hostname_fqdn: "{{ inventory_hostname }}"
|
||||
```
|
||||
|
||||
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') }}"
|
||||
```
|
||||
|
||||
The shortname defaulting to the part up to the first period of the FQDN, without the rest of the domain.
|
||||
|
||||
```yaml
|
||||
hostname_unsafe_writes: "{{ (ansible_virtualization_type == 'docker')|ternary('yes', 'no')|bool }}"
|
||||
```
|
||||
|
||||
Whether to use unsafe writes or atomic operations when updating system files. Defaults to atomic operations on all systems except for docker where mounted files cannot be updated atomically and can only be done in an unsafe manner.
|
||||
|
||||
## Dependencies
|
||||
|
||||
None.
|
||||
|
||||
## Example Playbook
|
||||
|
||||
- hosts: drupalvm
|
||||
roles:
|
||||
- drupalvm.hostname
|
||||
|
||||
## License
|
||||
|
||||
MIT / BSD
|
||||
|
||||
## Author Information
|
||||
|
||||
This role was created in 2017 by [Oskar Schöldström](http://oxy.fi) and [Jeff Geerling](https://www.jeffgeerling.com/) (author of [Ansible for DevOps](https://www.ansiblefordevops.com/)).
|
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
hostname_fqdn: "{{ inventory_hostname }}"
|
||||
hostname_short: "{{ hostname_fqdn|regex_replace('^([^.]+).*$', '\\1') }}"
|
||||
|
||||
hostname_unsafe_writes: "{{ (ansible_virtualization_type == 'docker')|ternary('yes', 'no')|bool }}"
|
28
box/provisioning/roles/drupalvm.hostname/meta/main.yml
Normal file
28
box/provisioning/roles/drupalvm.hostname/meta/main.yml
Normal file
|
@ -0,0 +1,28 @@
|
|||
---
|
||||
galaxy_info:
|
||||
author: Jeff Geerling
|
||||
description: A role to set the hostname and FQDN on Drupal VM.
|
||||
company: Midwestern Mac, LLC
|
||||
issue_tracker_url: https://github.com/geerlingguy/drupal-vm/issues
|
||||
license: MIT
|
||||
min_ansible_version: 2.2
|
||||
|
||||
platforms:
|
||||
- name: EL
|
||||
versions:
|
||||
- all
|
||||
- name: Debian
|
||||
versions:
|
||||
- all
|
||||
- name: Ubuntu
|
||||
versions:
|
||||
- precise
|
||||
- raring
|
||||
- saucy
|
||||
- trusty
|
||||
- xenial
|
||||
|
||||
galaxy_tags:
|
||||
- drupal
|
||||
- vm
|
||||
- hostname
|
25
box/provisioning/roles/drupalvm.hostname/tasks/main.yml
Normal file
25
box/provisioning/roles/drupalvm.hostname/tasks/main.yml
Normal file
|
@ -0,0 +1,25 @@
|
|||
---
|
||||
- name: Configure /etc/mailname (Debian).
|
||||
copy:
|
||||
content: "{{ hostname_fqdn }}\n"
|
||||
dest: /etc/mailname
|
||||
when: ansible_os_family == 'Debian'
|
||||
|
||||
- name: Add hostname to /etc/hosts.
|
||||
lineinfile:
|
||||
dest: /etc/hosts
|
||||
regexp: '.*\t{{ hostname_short }}$'
|
||||
line: "127.0.0.1\t{{ hostname_fqdn }}\t{{ hostname_short }}"
|
||||
state: present
|
||||
unsafe_writes: "{{ hostname_unsafe_writes }}"
|
||||
|
||||
- name: Configure hostname.
|
||||
copy:
|
||||
content: "{{ (ansible_os_family == 'Debian') | ternary(hostname_short, hostname_fqdn) }}\n"
|
||||
dest: /etc/hostname
|
||||
unsafe_writes: "{{ hostname_unsafe_writes }}"
|
||||
register: set_hostname
|
||||
|
||||
- name: Set the hostname for current session.
|
||||
shell: hostname --file /etc/hostname
|
||||
when: set_hostname.changed
|
Loading…
Add table
Add a link
Reference in a new issue