This repository has been archived by the owner on Feb 13, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 646
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes #84: Make Drupal VM prod-ready (with a DigitalOcean guide).
- Loading branch information
1 parent
532ccf7
commit e9c5cef
Showing
7 changed files
with
103 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
--- | ||
admin_user: my_admin_username | ||
|
||
# On RHEL/CentOS, 'wheel'; on Debian/Ubuntu, 'root'. | ||
admin_group: root | ||
|
||
# IMPORTANT: Configure your own password for the admin user account. To generate | ||
# a password hash, use either of the following commands: | ||
# - `openssl passwd -1 [password]` | ||
# - `mkpasswd --method=SHA-512`. | ||
admin_password: $1$HgT69GsW$qZ8FUJHafZZWD76KXgAZO/ | ||
|
||
# Configuration for copying local public SSH key to admin's authorized_keys. | ||
admin_copy_ssh_pubkey: true | ||
admin_pubkey: ~/.ssh/id_rsa.pub |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
--- | ||
- hosts: drupalvm | ||
|
||
vars_files: | ||
- vars.yml | ||
|
||
tasks: | ||
- name: Create admin user account. | ||
user: | ||
name: "{{ admin_user }}" | ||
createhome: yes | ||
home: "/home/{{ admin_user }}" | ||
generate_ssh_key: yes | ||
ssh_key_comment: "ansible-{{ inventory_hostname }}" | ||
password: "{{ admin_password }}" | ||
groups: "{{ admin_group }}" | ||
shell: /bin/bash | ||
|
||
- name: Add local SSH public key to admin account authorized_keys. | ||
authorized_key: | ||
user: "{{ admin_user }}" | ||
key: "{{ lookup('file', '{{ admin_pubkey }}') }}" | ||
manage_dir: yes | ||
|
||
- name: Disable requiretty. | ||
lineinfile: | ||
dest: /etc/sudoers | ||
regexp: '^Defaults.+requiretty' | ||
line: 'Defaults !requiretty' | ||
state: present |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
[drupalvm] | ||
1.2.3.4 ansible_ssh_user=root | ||
1.2.3.4 ansible_ssh_user=my_admin_username |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters