Skip to content

Commit

Permalink
Merge pull request #131 from fabianorosas/cleanup
Browse files Browse the repository at this point in the history
cleanup: Remove BVT and baremetal deployment code
  • Loading branch information
farosas authored Feb 26, 2018
2 parents 92faaa9 + 6cffa8d commit 63f31ac
Show file tree
Hide file tree
Showing 31 changed files with 4 additions and 1,009 deletions.
21 changes: 4 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,16 +108,15 @@ by Jenkins Ansible playbooks, so you do not need to do it manually.

### Automatically setup Jenkins master and slave(s) using Ansible playbooks

There are three Ansible playbooks: one that sets up a Jenkins master node,
and two that set up Jenkins slave nodes, either for building or executing
Build Verification Tests. Read the
There are two Ansible playbooks: one that sets up a Jenkins master node
and another one that sets up a Jenkins slave node. Read the
[Ansible instructions](ansible/README.md) for details on how to execute
the playbooks.

If you wish to have a single system hosting the entire Jenkins instance, the
If you wish to have a single system hosting the entire Jenkins instance, both
playbooks can be executed in the same system. Execute first the Jenkins master
playbook, stop Jenkins service (systemctl stop jenkins) and then execute the
other playbooks.
Jenkins slave playbook.

Note: The Jenkins playbooks may fail due to network errors. If you see HTTP
request errors, try executing them again.
Expand Down Expand Up @@ -181,18 +180,6 @@ of the slave in IP_ADDRESS job parameter. The other job parameters values do not
need to be modified. You should have already executed the Jenkins slave playbook(s)
on those slaves.

##### Create BVT slave in Jenkins web UI

The Build Verification Tests (BVT) use [Avocado](https://avocado-framework.github.io/)
to execute tests on virtual machines. The tests require passwordless access to
sudo, so it is recommended that a separate machine is used forthat purpose. It
may be a virtual machine, the tests will then run in a nested virtualized
guest.

To create the slave node from the Jenkins UI, follow the same instructions
above, setting the IP_ADDRESS and, additionally, changing the NODE_LABEL to
"bvt_slave_label".

#### Create builds jobs

When the credentials are configured, execute the seed job at
Expand Down
91 changes: 0 additions & 91 deletions ansible/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,96 +62,5 @@ artifacts to the configured remote server.
- Path to the SSH known keys for remote hosts, usually `~/.ssh/known_hosts`.
The local file is just copied to remote target.

- `bvt-host.yaml` playbook

- Paths to SSH private and public keys used to communicate between master
and slave nodes.
- Path to the SSH private key used to upload artifacts to the configured
remote server.
- Path to the SSH known keys for remote hosts, usually
`~/.ssh/known_hosts`. The local file is just copied to remote target.

Provide the data requested by the playbooks (e.g. Jenkins admin user name/password
and SSH keys locations) and wait for automatic setup to finish.

## Baremetal provisioning via Ansible

The `bm-deploy.yaml` playbook allows the provisioning of a POWER
(baremetal) machine using PXE. A "controller node" that can serve DHCP
to the machine being provisioned is required.

The deployment consists of two steps:

### Preparation of the controller node

This is a one time operation needed to prepare the machine that will
be used as controller for the provisioning. This machine should be in
the same network as the to-be provisioned (target) machine (this is
due to the requirement of serving DHCP to the target machine). Using a
virtual machine is OK.

The controller node is referred to in the `hosts.ini` file as
`[baremetal-ctrl]`.

Run once for each controller setup:
```
ansible-playbook -i hosts.ini --tags=setup bm-deploy.yaml
```

After that, the controller node will be capable of serving files to
the target machine.

For detailed info, see the [baremetal-ctrl](roles/baremetal-ctrl) role.

### Deployment

This step is executed each time a machine needs to be provisioned. It
uses IPMI to power the machine on/off, DHCP for setting up PXE and
HTTP for serving files. Services on the controller node are started on
demand.

Prerequisites:

- The variables file vars-baremetal.yaml should be edited with
information about the baremetal machine prior to execution of the
"deploy" tag.

- A .iso file named after the MAC address of the network interface of
the target machine (<mac_address>_deploy.iso) is expected to be at
/tmp.

```
cp <iso_file> /tmp/<ma:ca:dd:re:ss>_deploy.iso
```

Run every time a deploy is required:
```
ansible-playbook -i hosts.ini --tags=deploy bm-deploy.yaml
```

#### Deployment flow

The flow of the deploy after the user runs the playbook with the
"deploy" tag (C - controller node, B - baremetal node) is:

- C: Mount ISO file inside the HTTP server directory
- C: Using IPMI, set machine to boot via network
- C: Using IPMI, turn the baremetal machine on
- C: Serve DHCP along with PXE configuration file location


- B: Boot and download PXE configuration file from HTTP server containing kickstart location and boot params
- B: Install via kickstart
- B: Run post script that adds authorized SSH keys and starts SSH server
- C: Detect that installation has finished by SSH server presence
- C: Fetch installed filesystem UUID
- C: Copy kernel/initramfs to the controller node
- C: Reconfigure PXE to boot the new installation


- C: Using IPMI, turn the machine off
- C: Using IPMI, turn the back machine on

Deployment is finished and machine is accessible via SSH

For detailed info, see the [deploy-baremetal](roles/deploy-baremetal) role.
11 changes: 0 additions & 11 deletions ansible/bm-deploy.yaml

This file was deleted.

30 changes: 0 additions & 30 deletions ansible/bvt-host.yaml

This file was deleted.

6 changes: 0 additions & 6 deletions ansible/hosts.ini
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,3 @@ host-os-jenkins.example.com
[jenkins-slave]
host-os-jenkins-slave01.example.com
host-os-jenkins-slave02.example.com

[baremetal-ctrl]
host-os-jenkins-slave04.example.com

[bvt-host]
host-os-bvt-host.example.com
10 changes: 0 additions & 10 deletions ansible/roles/avocado-repo/tasks/main.yaml

This file was deleted.

10 changes: 0 additions & 10 deletions ansible/roles/avocado/defaults/main.yaml

This file was deleted.

10 changes: 0 additions & 10 deletions ansible/roles/avocado/files/host-os-bvt.ini

This file was deleted.

11 changes: 0 additions & 11 deletions ansible/roles/avocado/handlers/main.yaml

This file was deleted.

5 changes: 0 additions & 5 deletions ansible/roles/avocado/meta/main.yaml

This file was deleted.

127 changes: 0 additions & 127 deletions ansible/roles/avocado/tasks/main.yaml

This file was deleted.

11 changes: 0 additions & 11 deletions ansible/roles/avocado/templates/avocado.conf.j2

This file was deleted.

11 changes: 0 additions & 11 deletions ansible/roles/baremetal-ctrl/defaults/main.yaml

This file was deleted.

6 changes: 0 additions & 6 deletions ansible/roles/baremetal-ctrl/meta/main.yaml

This file was deleted.

Loading

0 comments on commit 63f31ac

Please sign in to comment.