Update documentation.

This commit is contained in:
mharb 2023-07-31 10:49:43 -04:00
parent cc4515ac16
commit c06c39871e
1 changed files with 83 additions and 2 deletions

View File

@ -1,3 +1,84 @@
# oci-tf-ans-selfhost-dev
# Oracle Self-Hosted Playground (WIP NOT COMPLETE)
A template for self-hosting on Oracle's free-tier compute.
## Abstract
In this project we attempt to automate playground provisioning in Oracle Cloud. The playground(s) includes various infrastructure, software, and service deployments. The playground serves as a remote non-production environment.
## Requirements
The author(s) assumes the reader has access to Oracle Cloud's free-tier and sufficient IAM permissions. Access to provisioned resources requires an OCI API key and a personal SSH key.
## Tooling
* `Ansible >= 7.5.0`
* `Terraform >= 1.4.XYZ`
* provider: `oracle/oci >= v4.118.0`
* optional: `ansible-lint >= 6.16.XYZ`
## Usage
1. Install requirements
1. Configure Cloud Account
1. Clone repository
1. Add appropriate ingress rule within `network-subnet-public.tf`
1. Generate a `.tfvars` file using the template `tfvars.skel`
* Variables are graciously documented in this [repository](https://github.com/gszathmari/homelab-on-oracle-cloud)
1. `terraform init`
1. `terraform plan`
1. `terraform apply`
1. Add new compute IP address to `/etc/ansible/hosts`
1. Update the IP address(es) in `nginx.conf` to enable 80->443 redirection
1. Apply the desired playbook
**DO NOT STORE SSH KEYS, API KEYS, OR TERRAFORM STATE FILES REMOTELY. PLEASE KEEP THEM SECURE ON YOUR LOCAL MACHINE**
## Testing and Debugging
Terraform and Ansible provide simple linting and validation functionality. Keep in mind validation or linting does not guarantee a successful deployment.
### Terraform
Quickly check your plans: `terraform fmt && terraform validate`
### Ansible
Quickly check your playbooks: `ansible-lint yourplaybookfile.yml`
## "Apps"
* [ ] Self-hosted VS Code
* [ ] Wolfree Alpha mirror
* [ ] Self-hosted CDN with Hitch and Varnish
## Attribution
* [Repo 1](https://github.com/gszathmari/homelab-on-oracle-cloud)
* [Repo 2](https://github.com/admiralakber/homelab-on-oracle-cloud)
* [Getting Started with Terraform in OCI](https://docs.oracle.com/en-us/iaas/developer-tutorials/tutorials/tf-simple-infrastructure/01-summary.htm)
* [Ansible Documentation regarding Docker](https://docs.ansible.com/ansible/latest/collections/community/docker/docsite/scenario_guide.html)
## Warning
THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
`TL;DR: Not my problem`
## License
The `GPL V2` license applies to this project. All copyrights belong to their respective copyright holders and all trademarks belong to their trademark holders.
```
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.)
```