Skip to content

Instantly share code, notes, and snippets.

@matsuu
Last active September 7, 2020 13:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save matsuu/6581b4fb279b8a4a38783ce1ff4652c2 to your computer and use it in GitHub Desktop.
Save matsuu/6581b4fb279b8a4a38783ce1ff4652c2 to your computer and use it in GitHub Desktop.
user-data for isucon9q
#cloud-config
password: isucon
chpasswd:
expire: False
ssh_pwauth: True
write_files:
- content: |
#!/bin/sh
set -e
export DEBIAN_FRONTEND=noninteractive
export HOME=/root
apt-get update
apt-get install -y --no-install-recommends ansible git
GITDIR="${HOME}/ansible-isucon9-qualify"
rm -rf ${GITDIR}
git clone https://github.com/matsuu/ansible-isucon9-qualify.git ${GITDIR}
(
cd ${GITDIR}
PYTHONUNBUFFERED=1 ANSIBLE_FORCE_COLOR=true ansible-playbook -i webapp, --connection=local standalone.yml
)
rm -rf ${GITDIR}
# for virtualbox
# https://bugs.launchpad.net/cloud-images/+bug/1573095
sed -i -e "s/ console=ttyS0//" /etc/default/grub.d/50-cloudimg-settings.cfg
update-grub
owner: root:root
path: /var/lib/cloud/scripts/per-once/isucon.sh
permissions: '0755'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment