Compare commits

..
4 Commits
Author SHA1 Message Date
niku 4f3de27656 Removed README.md 2022-03-15 08:41:04 +01:00
niku 7b00e6d893 Prevent accidental .ssh overwrite fuck up 2022-03-15 08:35:34 +01:00
niku 63b959c8cd Better indication no postgres instance detected 2022-03-15 08:34:58 +01:00
niku 04a7ff551c Fixed broken ansible package install_deps.sh 2022-03-15 08:30:07 +01:00
4 changed files with 14 additions and 29 deletions
-17
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
```
-2
View File
@@ -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>
+12 -10
View File
@@ -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)