Compare commits

..

4 Commits

4 changed files with 14 additions and 29 deletions

View File

@ -1,17 +0,0 @@
# infra-as-code
## Setup
In order to create customers a one-time setup has to be done. Execute the following command to get started:
```sh
./install_deps.sh
```
You can now start creating customers!
## Create customer
```sh
./self_service.sh
```
## Remove a customer
```sh
./rm_customer.sh $CUSTOMER_NAME
```

View File

@ -1,6 +1,4 @@
#!/usr/bin/env bash
sudo apt update --yes && sudo apt upgrade --yes
sudo apt install software-properties-common
sudo add-apt-repository --yes --update ppa:ansible/ansible
sudo apt install --yes virtualbox vagrant ansible
ansible-galaxy install -r ./requirements.yml

View File

@ -28,6 +28,8 @@
var_dump(pg_fetch_all($result));
?>
</p>
{% else %}
<p>No postgres instance detected.</p>
{% endif %}
</body>
</html>

View File

@ -135,16 +135,18 @@ def create_env(args: argparse.Namespace):
# Generate .ssh
ssh_dir = path.join(env_path, ".ssh")
Path(ssh_dir).mkdir(exist_ok=True)
ssh_key_cmd = [
"ssh-keygen",
"-t",
"rsa",
"-b",
"2048",
"-f",
path.join(ssh_dir, "id_rsa"),
]
sub.call(ssh_key_cmd)
rsa_path = path.join(ssh_dir, "id_rsa")
if not Path(rsa_path).exists():
ssh_key_cmd = [
"ssh-keygen",
"-t",
"rsa",
"-b",
"2048",
"-f",
rsa_path,
]
sub.call(ssh_key_cmd)
# Provision and configure machines
sub.call(["vagrant", "up"], cwd=env_path)