Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
c93f414
manual installation of glance openstack component
Donemmanuelo Jun 30, 2025
859fcce
glance openstack component installation using ansible
Donemmanuelo Jun 30, 2025
5c7d735
fixed some markdown lint issues
Donemmanuelo Jun 30, 2025
d0887cf
glance openstack component installation using ansible
Donemmanuelo Jun 30, 2025
558aee5
Update accept.txt
Donemmanuelo Jun 30, 2025
f50a5a0
glance openstack installation using ansible
Donemmanuelo Jun 30, 2025
633d5bd
fixed the project structure
Donemmanuelo Jun 30, 2025
3ec3359
documentation on how to configure network interfaces using netplan al…
Donemmanuelo May 21, 2025
c673c51
Delete docs/playbook.yaml
onelrian Jun 2, 2025
f5de228
docs(netplan): documentation on how to configure network interface us…
Donemmanuelo Jun 2, 2025
de2079e
docs(netplan): documentation on how to configure network interface us…
Donemmanuelo Jun 2, 2025
6cd98a3
docs(netplan): documentation on how to configure network interface us…
Donemmanuelo Jun 2, 2025
f82a404
made some changes
Donemmanuelo Jun 4, 2025
34d97fe
Update netplan_doc.md
Donemmanuelo Jun 3, 2025
ff32c7b
Update netplan_doc.md
Donemmanuelo Jun 4, 2025
600e2e7
fix error related to markdown linting
Donemmanuelo Jun 4, 2025
57ec636
fix error related to markdown linting
Donemmanuelo Jun 4, 2025
68a3706
fix error related to markdown linting
Donemmanuelo Jun 4, 2025
109646d
fix error related to markdown linting
Donemmanuelo Jun 4, 2025
b25bc71
fix error related to markdown linting
Donemmanuelo Jun 4, 2025
4ef4f05
fix error related to markdown linting
Donemmanuelo Jun 4, 2025
736353b
fix error related to markdown linting
Donemmanuelo Jun 4, 2025
7acd360
fix error related to markdown linting
Donemmanuelo Jun 4, 2025
e054d38
fix error related to markdown linting
Donemmanuelo Jun 4, 2025
b2770b9
fix error related to markdown linting
Donemmanuelo Jun 4, 2025
f2b20c0
fix(file structure): organised file system structure
Jagoum May 31, 2025
9e5ac10
fix(file structure): change some new files position
Jagoum May 31, 2025
d53bdd1
manual installation of glance openstack component
Donemmanuelo Jun 30, 2025
e437152
glance openstack component installation using ansible
Donemmanuelo Jun 30, 2025
aaca5ae
fixed some markdown lint issues
Donemmanuelo Jun 30, 2025
ff57c34
glance openstack component installation using ansible
Donemmanuelo Jun 30, 2025
b051fe6
Update accept.txt
Donemmanuelo Jun 30, 2025
7561e3d
glance openstack installation using ansible
Donemmanuelo Jun 30, 2025
3817d4a
fixed the project structure
Donemmanuelo Jun 30, 2025
59d3add
full glance installation, along with keystone and some test
Donemmanuelo Jul 10, 2025
b72c057
added a script uninstall glance and keystone
Donemmanuelo Jul 15, 2025
be7be88
added a script uninstall glance and keystone
Donemmanuelo Jul 15, 2025
04e2055
added a script uninstall glance and keystone
Donemmanuelo Jul 15, 2025
98c8fd1
fixed the issue related to column_case_sensitive
Donemmanuelo Jul 16, 2025
ba72bf1
fixed the PyMySQL issue
Donemmanuelo Jul 26, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file modified README.md
100644 → 100755
Empty file.
4 changes: 2 additions & 2 deletions docs/VLAN.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ the same network switch.
There are two types of VLANs:

- **Port-Based VLAN**: A VLAN is assigned to a particular port, and any machine
connected to that port automatically joins that VLAN
connected to that port automatically joins that VLAN.
- **User-Based or Dynamic VLAN**: VLANs are assigned based on user
authentication or other dynamic criteria
authentication or other dynamic criteria.

## Network Architecture

Expand Down
26 changes: 13 additions & 13 deletions docs/ansible_docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ how to install Ansible here:
Ansible provides several tools to facilitate server management:

- **OpenSSH**: Used for setting up SSH and generating keys for server
authentication
authentication.
- **Ad-hoc Commands**: Used as alternatives to playbooks for quick and simple
tasks
tasks.
- **Playbooks**: YAML files containing specific tasks to manage servers, used
for complex tasks
for complex tasks.
- **Inventory File**: Contains the list of servers grouped by categories for
organized management
organized management.

## How It Works

Expand All @@ -31,8 +31,8 @@ Ansible relies on SSH to authenticate and configure servers. While you can use a
single SSH key for managing all servers, it is often recommended to use two
separate keys:

- One for personal SSH logins
- Another specifically for automation with Ansible
- One for personal SSH logins.
- Another specifically for automation with Ansible.

#### Creation of SSH Keys

Expand Down Expand Up @@ -72,9 +72,9 @@ For more details, see:
Playbooks define the automation logic in a structured way. When you run a
playbook, Ansible:

1. Loads temporary modules to the remote server
2. Executes the tasks (e.g., install packages, start services)
3. Removes the modules after execution
1. Loads temporary modules to the remote server.
2. Executes the tasks (e.g., install packages, start services).
3. Removes the modules after execution.

For more details on playbooks:

Expand All @@ -95,15 +95,15 @@ To learn more about ad-hoc commands, see:
Ansible excels at server management by providing:

- **Playbooks**: Makes task handover between teams seamless, as all required
tasks are documented in playbooks
tasks are documented in playbooks.
- **Inventory Files**: Organizes server IP addresses by groups, making it easy
to manage and assign tasks
to manage and assign tasks.
- **SSH Key**: Automates authentication, making server access and management
more efficient
more efficient.

## What If Ansible Becomes Outdated?

If Ansible becomes outdated or no longer maintained, other modern tools can be
If Ansible becomes outdated or is no longer maintained, other modern tools can be
used for infrastructure automation and server management:

- [Chef](https://docs.chef.io/manage/)
Expand Down
Empty file modified mkdocs.yml
100644 → 100755
Empty file.
416 changes: 416 additions & 0 deletions playbooks/docs/glance-ansible_docs.md

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions playbooks/glance-ansible/ansible.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[defaults]
inventory = inventory.ini
host_key_checking = False
retry_files_enabled = False
175 changes: 175 additions & 0 deletions playbooks/glance-ansible/glance.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,175 @@
# OpenStack Keystone + Glance Installation (Ansible-Based)

This documentation describes a fully automated installation of **Keystone** (Identity Service) and **Glance** (Image Service) using **Ansible**. The playbook provisions and configures required services, sets up databases, initializes Keystone, registers Glance, and validates the image upload process.

---

## Project Layout

```
├── ansible.cfg
├── group_vars
│   └── all.yml
├── inventory.ini
├── playbook.yml
└── roles
├── glance
│   ├── tasks
│   │   └── main.yml
│   ├── templates
│      ├── glance-api-paste.ini.j2
│      └── glance-api.conf.j2
│  
├── keystone
│   ├── tasks
│   │   └── main.yml
│   ├── templates
│       └── wsgi-keystone.conf.j2
│ 
└── test-setup
├── tasks
│   └── main.yml
└── vars
└── main.yml
```
---

## ⚙️ Variable Configuration (`group_vars/all.yml`)

```yaml
# Database passwords
mysql_root_pass: newpassword
keystone_db_pass: keystone_db_pass
glance_db_pass: GlancePass123!

# Keystone admin credentials
keystone_admin_pass: admin

# Glance user password
glance_user_pass: GlancePass123!

# Host and ports
controller_host: localhost
keystone_port: 5001

# Glance test image config
image_file: cirros-0.6.2-x86_64-disk.img
image_name: test-cirros
disk_format: qcow2
container_format: bare

# Keystone/Glance endpoints
keystone_url: http://localhost:5001/v3
glance_url: http://localhost:9292/v2

# Keystone auth scope
admin_user: admin
admin_pass: admin
project_name: admin
domain_name: Default
```

---

## Keystone Installation (`roles/keystone/tasks/main.yml`)

### Packages

- Installs: MariaDB, Apache2, WSGI, Memcached, Keystone, OpenStack client, Python packages

### MariaDB Configuration

- Ensures `bind-address = 127.0.0.1`
- Creates `keystone` database
- Grants privileges to `keystone` user (for `localhost` and `%`)

### Keystone Config

- Configures `keystone.conf`:
- `[database]` connection string
- `[token]` provider = `fernet`
- Runs:
- `keystone-manage fernet_setup`
- `keystone-manage credential_setup`
- `keystone-manage db_sync`
- `keystone-manage bootstrap`

### Apache WSGI

- Adds Keystone virtual host on port `5001`
- Enables the site and restarts Apache

---

## Glance Installation (`roles/glance/tasks/main.yml`)

### Database

- Creates `glance` database
- Grants user privileges for `glance` user

### Configuration

- Renders `glance-api.conf` and `glance-api-paste.ini` from templates
- Sets ownership to `glance:glance`, mode `0640`
- Runs `glance-manage db_sync`

### Service Setup

- Enables and restarts `glance-api` systemd service

### Keystone Integration

- Creates:
- `service` project
- `glance` user
- Role binding: `glance` as `admin` in `service`
- Registers Glance:
- Service type: `image`
- Endpoints: `public`, `internal`, `admin` at `http://localhost:9292`

---

## Validation (`roles/test-setup/tasks/main.yml`)

### Authentication

- Sends `POST /v3/auth/tokens` to Keystone
- Extracts `X-Subject-Token` as auth token

### Glance API Check

- Polls `GET /images` until 200 OK is received

### Cirros Image Upload

1. Downloads image if missing
2. Sends metadata via `POST /images`
3. Extracts image `id` from response
4. Uploads binary using `PUT /images/<id>/file`
5. Lists images with `GET /images`
6. Deletes test image using `DELETE /images/<id>`

---

## Troubleshooting

| Issue | Cause | Fix |
|-------|-------|-----|
| **403 Forbidden on Keystone** | Apache WSGI misconfigured | Ensure `Require all granted` in VirtualHost |

Check failure on line 159 in playbooks/glance-ansible/glance.md

View workflow job for this annotation

GitHub Actions / lint-docs

[vale] reported by reviewdog 🐶 [Vale.Spelling] Did you really mean 'misconfigured'? Raw Output: {"message": "[Vale.Spelling] Did you really mean 'misconfigured'?", "location": {"path": "playbooks/glance-ansible/glance.md", "range": {"start": {"line": 159, "column": 47}}}, "severity": "ERROR"}
| **Image upload fails** | Bad image ID or Glance not ready | Confirm metadata created and Glance is running |
| **Token missing** | Wrong credentials or Keystone unreachable | Double-check `keystone_url` and auth info |
| **DB connection error** | Wrong password or bind-address issue | Check MariaDB logs and config |

---

## Expected Results

After running the playbook:

- Keystone is reachable at: `http://localhost:5001/v3`
- Glance is reachable at: `http://localhost:9292/v2`
- Keystone admin and Glance service users are functional
- Cirros image is uploaded and deleted via Glance API


6 changes: 6 additions & 0 deletions playbooks/glance-ansible/glance.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
- name: Deploy OpenStack Keystone and Glance
hosts: controller
become: true
roles:
- keystone
- glance
8 changes: 8 additions & 0 deletions playbooks/glance-ansible/group_vars/all.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
mysql_root_pass: "newpassword"
keystone_db_pass: "keystone_db_pass"
keystone_admin_pass: "admin"
admin_token: "ADMIN"
glance_db_pass: "GlancePass123!"
glance_user_pass: "GlancePass123!"
controller_host: "localhost"
keystone_port: 5001
2 changes: 2 additions & 0 deletions playbooks/glance-ansible/inventory.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[all]
localhost ansible_connection=local
10 changes: 10 additions & 0 deletions playbooks/glance-ansible/playbook.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
- name: Setup OpenStack Keystone, Glance and Test
hosts: all
connection: local
become: true

roles:
- keystone
- glance
- test-setup
7 changes: 7 additions & 0 deletions playbooks/glance-ansible/roles/glance/defaults/main.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
new_mysql_root_pass: newpassword
glance_db_pass: GlancePass123!
glance_user_pass: GlancePass123!
controller_host: localhost
keystone_port: 5001
keystone_admin_pass: admin
Loading
Loading