Skip to content

Commit

Permalink
Quick Start
Browse files Browse the repository at this point in the history
  • Loading branch information
bbaassssiiee committed Dec 16, 2024
1 parent 4d4eea4 commit 1ec77e8
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 24 deletions.
35 changes: 25 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,38 +19,53 @@ This project provides a development environment for deploying an Ansible Control
In this production-like setup, Semaphore, PostgreSQL and Nginx, run directly on the host system.
This setup can host Clusterlust - the project to create a Kubernetes cluster with Kubespray.

## Installation
## Quick Start Windows/macOS/Ubuntu Laptop

Follow these steps to set up the environment:
### Follow these steps to set up the environment:

1. **Prerequisites**:
1. You will need a Hypervisor to create a virtual machine on your machine with **Vagrant** (discussed below).
- [VirtualBox](https://www.virtualbox.org/), available for Windows/macOS/Linux
- **Hyper-V** a Windows-only feature.
- [Vagrant](https://www.vagrantup.com/) available for Windows/macOS/Linux, download and install.

**Note**: The `inventory/local` configuration is suitable for direct deployment on systems like Ubuntu Jammy, Red Hat, AlmaLinux, or Rocky Linux (8). In this setup, Vagrant and VirtualBox are not required.
- [VirtualBox](https://www.virtualbox.org/), installed on your laptop.
- [Vagrant](https://www.vagrantup.com/) installed on your laptop.
2. Create a sub-directory named `controller` on your machine.
3. Copy the `Vagrantfile.template` from this repository to `Vagrantfile` in this directory.
4.
- If on Windows start an Administrator Powershell and change directory to the directory controller.
- In on Mac start a terminal and change directory to the directory controller.
5. Run `vagrant up` and take not of the IP address that is logged.
6. Browse with https to the IP address. (NOTE: The certificate is self-signed at first.)

2. **Clone the repository**:
## Quick Start AlmaLinux controller host

### Prerequisites**:

**Note**: The `inventory/local` configuration is suitable for direct deployment on systems like Red Hat, AlmaLinux, Rocky Linux (8), or Ubuntu Jammy. In this setup, Vagrant and VirtualBox are not required.

### Follow these steps to set up the environment:

1. **Clone the repository**:

```bash
git clone https://github.com/playingfield/controller.git
cd controller
```
3. **Install Ansible in a Python virtualenv**:
2. **Install Ansible in a Python virtualenv**:

```bash
source ansible.sh
./prepare.sh
```

4. **Define the variables in inventory/{{ name }}/group_vars**:
3. **Define the variables in inventory/{{ name }}/group_vars**:
For instance, when you use the `local` inventory on an Ubuntu 22.04 machine, change this file
`inventory/local/group_vars/database.yml` from 15 to 14:

```yaml
postgres_version: 14
```
5. **Define these secrets as environment variables**
4. **Define these secrets as environment variables**
Store them in a safe place afterwards:
```bash
Expand Down
18 changes: 4 additions & 14 deletions Vagrantfile.template
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# -*- mode: ruby -*-
# vi: set ft=ruby :
# To use these virtual machines install Vagrant and VirtualBox.
# vagrant up
# To use these virtual machines install Vagrant and Hyper-V or VirtualBox.

Vagrant.require_version ">= 2.0.0"
Vagrant.configure(2) do |config|
Expand All @@ -21,19 +20,15 @@ Vagrant.configure(2) do |config|

# use the standard vagrant ssh key
config.ssh.insert_key = false

# Iterate through entries in JSON file

config.vm.box = "ansiblebook/controller"
config.vm.hostname = "controller"
config.vm.network "public_network", type: "dhcp", bridge: "Wi-Fi"
config.vm.network :forwarded_port, host: 8443, guest: 443

# set no_share to false to enable file sharing
config.vm.synced_folder ".", "/vagrant", id: "vagrant-root", disabled: true
config.vm.provider "hyperv" do |hyperv|
hyperv.cpus = 4
hyperv.memory = 4096
hyperv.memory = 8192
hyperv.vmname = "controller"
hyperv.enable_virtualization_extensions = true
hyperv.vm_integration_services = {
Expand All @@ -44,17 +39,12 @@ Vagrant.configure(2) do |config|
}
hyperv.linked_clone = true
end
config.vm.provider :vmware_desktop do |vmware|
vmware.gui = false
vmware.vmx['memsize'] = 4096
vmware.vmx['numvcpus'] = 4
end
config.vm.provider :virtualbox do |virtualbox|
virtualbox.customize ["modifyvm", :id,
"--audio-driver", "none",
"--cpus", 4,
"--memory", 4096,
"--natnet1", "192.168.33.0/24",
"--memory", 8192,
"--natnet1", "192.168.33.0/24",
"--graphicscontroller", "VMSVGA",
"--vram", "64"
]
Expand Down

0 comments on commit 1ec77e8

Please sign in to comment.