Skip to content

Commit

Permalink
Merge pull request #1 from very-random-man/switch-to-ddev
Browse files Browse the repository at this point in the history
Switch to ddev
  • Loading branch information
very-random-man authored Nov 9, 2023
2 parents 25e1da4 + b4b8150 commit 368fd25
Show file tree
Hide file tree
Showing 6 changed files with 136 additions and 156 deletions.
23 changes: 12 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,26 @@
# Win10 WSL2 development environment provisioner
# Windows WSL2 development environment provisioner

This is an Ansible-based provisioning tool to set up a bunch of Ubuntu cli development tools. It is specifically for Windows 10 WSL2 and was created with destroying and rebuilding the WSL2 environment in mind. It will sync SSH keys between the WSL2 and Win10 user directories so they wont be lost. I'm assuming everything else will be source controlled.
This is an Ansible-based provisioning tool to set up a local Drupal development environment in Windows WSL2.

The use case is either creating a base setup or keeping multiple WSL2 environments consistent on a single machine
as you would if you use [wsl2-distro-manager](https://github.com/bostrot/wsl2-distro-manager).

It will sync SSH keys between the WSL2 and Windows user directories so they wont be lost. I'm assuming everything
else will be source controlled.

- Run this to install Ansible and provision:
```
./build.sh
```
- You can re-run that script to re-provision. You can save a bit of time with `--skip-roles` and it wont fetch all the roles from ansible-galaxy.
- You can re-run that to re-provision. You can save a bit of time with `--skip-roles` and it wont fetch all the
roles from ansible-galaxy.

## So what gets installed?

- Keychain
- Unison
- Apache
- Apache PHP FPM
- PHP 7.2
- PHP 8.1
- Composer
- Node JS
- NPM
- yarn
- Vagrant
- Docker
- Lando

- DDEV
6 changes: 3 additions & 3 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ This script will initiate ansible provisioning to build a dev environment.
Usage: $PROGNAME [-h,--help] [-s,--skip-roles]
-h, --help: This information.
-s, --skip-roles: Don't reinstall ansible roles via galaxy
-h, --help: This information.
-s, --skip-roles: Don't reinstall ansible roles via galaxy
EOF
exit 1
Expand Down Expand Up @@ -50,7 +50,7 @@ else
sudo apt update
sudo apt install software-properties-common
sudo apt-add-repository --yes --update ppa:ansible/ansible
sudo apt install ansible
sudo apt -y install ansible
fi

PROJECT_ROOT=$PWD
Expand Down
7 changes: 0 additions & 7 deletions init.sh

This file was deleted.

33 changes: 18 additions & 15 deletions inventory/group_vars/all.yml
Original file line number Diff line number Diff line change
@@ -1,35 +1,33 @@
php_version: 7.2
check_mode: no

php_version: '8.1'
php_display_errors: "On"
php_date_timezone: "Europe/London"

apache_create_vhosts: false
apache_remove_default_vhost: true
apache_state: stopped

docker_users:
- "{{ lookup('env','USER') }}"

lando_version: "v3.0.0-rc.23"
php_enable_webserver: false

skip_roles: "{{ skip_roles }}"

profile: |
lsb_release -d
export WINHOME={{ lookup('env','WINHOME') }}
export VAGRANT_WSL_ENABLE_WINDOWS_ACCESS="1"
export DRUPALVM_ENV=wsl2-local
keychain $HOME/.ssh/id_rsa
source $HOME/.keychain/{{ lookup('env','NAME') }}-sh
export JAMES=something
bash: |
if [ "$color_prompt" = yes ]; then
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w$(__git_ps1)\[\033[00m\]\$ '
else
PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w$(__git_ps1)\$ '
fi
PROMPT_COMMAND="history -a; history -n"
wsl_conf: |
[automount]
options="metadata,umask=0033"
gitconfig: |
[user]
name = jsherwin
email = [email protected]
[core]
autocrlf = true
Expand All @@ -39,3 +37,8 @@ gitconfig: |
[gc]
auto = 256
[pull]
rebase = false
[init]
defaultBranch = main
Loading

0 comments on commit 368fd25

Please sign in to comment.