Compare commits
4 Commits
0b574e24bb
...
4f3de27656
Author | SHA1 | Date | |
---|---|---|---|
4f3de27656 | |||
7b00e6d893 | |||
63b959c8cd | |||
04a7ff551c |
17
README.md
17
README.md
@ -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
|
|
||||||
```
|
|
@ -1,6 +1,4 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
sudo apt update --yes && sudo apt upgrade --yes
|
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
|
sudo apt install --yes virtualbox vagrant ansible
|
||||||
ansible-galaxy install -r ./requirements.yml
|
ansible-galaxy install -r ./requirements.yml
|
||||||
|
@ -28,6 +28,8 @@
|
|||||||
var_dump(pg_fetch_all($result));
|
var_dump(pg_fetch_all($result));
|
||||||
?>
|
?>
|
||||||
</p>
|
</p>
|
||||||
|
{% else %}
|
||||||
|
<p>No postgres instance detected.</p>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
22
service.py
22
service.py
@ -135,16 +135,18 @@ def create_env(args: argparse.Namespace):
|
|||||||
# Generate .ssh
|
# Generate .ssh
|
||||||
ssh_dir = path.join(env_path, ".ssh")
|
ssh_dir = path.join(env_path, ".ssh")
|
||||||
Path(ssh_dir).mkdir(exist_ok=True)
|
Path(ssh_dir).mkdir(exist_ok=True)
|
||||||
ssh_key_cmd = [
|
rsa_path = path.join(ssh_dir, "id_rsa")
|
||||||
"ssh-keygen",
|
if not Path(rsa_path).exists():
|
||||||
"-t",
|
ssh_key_cmd = [
|
||||||
"rsa",
|
"ssh-keygen",
|
||||||
"-b",
|
"-t",
|
||||||
"2048",
|
"rsa",
|
||||||
"-f",
|
"-b",
|
||||||
path.join(ssh_dir, "id_rsa"),
|
"2048",
|
||||||
]
|
"-f",
|
||||||
sub.call(ssh_key_cmd)
|
rsa_path,
|
||||||
|
]
|
||||||
|
sub.call(ssh_key_cmd)
|
||||||
|
|
||||||
# Provision and configure machines
|
# Provision and configure machines
|
||||||
sub.call(["vagrant", "up"], cwd=env_path)
|
sub.call(["vagrant", "up"], cwd=env_path)
|
||||||
|
Reference in New Issue
Block a user