diff --git a/README.rst b/README.rst index 90046490b..aacc980ca 100644 --- a/README.rst +++ b/README.rst @@ -11,11 +11,11 @@ This is split into roughly three steps: - install: prepare the local environment by downloading and/or building machine images, and installing and configuring the necessary services. -- enroll: +- enroll-dynamic: take as input a customizable hardware inventory file and enroll the listed hardware with Ironic, configuring each appropriately for deployment with the previously-downloaded images. -- deploy: +- deploy-dynamic: instruct Ironic to deploy the operating system onto each machine. Supported Operating Systems: @@ -285,15 +285,6 @@ source, and then executing the the enrollment playbook.:: export BIFROST_INVENTORY_SOURCE=/tmp/baremetal.json ansible-playbook -vvvv -i inventory/bifrost_inventory.py enroll-dynamic.yaml -The legacy enroll.yaml playbook requires a variable (baremetal_csv_file) be -set or passed into the playbook execution. NOTE: This MUST be the full path -to the CSV file to be consumed by the Ansible playbooks and loaded into -ironic. - -Example:: - - ansible-playbook -i inventory/localhost -vvvv enroll.yaml -e baremetal_csv_file=inventory/baremetal.csv - Note that enrollment is a one-time operation. The Ansible module *does not* synchronize data for existing nodes. You should use the Ironic CLI to do this manually at the moment. @@ -312,24 +303,17 @@ utilize configuration drives to convey basic configuration information to the each host. This configuration information includes an SSH key to allow a user to login to the system. -This case is the same between the newer deploy-dynamic.yaml playbook and the -older legacy deploy.yaml playbook. - To utilize the newer dynamic inventory based deployment:: export BIFROST_INVENTORY_SOURCE=/tmp/baremetal.json ansible-playbook -vvvv -i inventory/bifrost_inventory.py deploy-dynamic.yaml -To utilize the legacy csv file based playbook:: - - ansible-playbook -i inventory/localhost -vvvv deploy.yaml -e baremetal_csv_file=inventory/baremetal.csv - Testing with a single command ============================= A simple ``scripts/test-bifrost.sh`` script can be utilized to install pre-requisite software packages, Ansible, and then execute the test-bifrost.yaml playbook in order to provide a single step testing mechanism. -The playbook utilized by the script, ``playbooks/test-bifrost.yaml``, is a single playbook that will create a local virtual machine, save a baremetal.csv file out, and then utilize it to execute the remaining roles. Two additional roles are invoked by this playbook which enables Ansible to connect to the new nodes by adding them to the inventory, and then logging into the remote machine via the user's ssh host key. Once that has successfully occurred, additional roles will unprovision the host(s) and delete them from Ironic. +The playbook utilized by the script, ``playbooks/test-bifrost-dynamic.yaml``, is a single playbook that will create a local virtual machine, save a baremetal.csv file out, and then utilize it to execute the remaining roles. Two additional roles are invoked by this playbook which enables Ansible to connect to the new nodes by adding them to the inventory, and then logging into the remote machine via the user's ssh host key. Once that has successfully occurred, additional roles will unprovision the host(s) and delete them from Ironic. Command:: diff --git a/playbooks/deploy.yaml b/playbooks/deploy.yaml index 23bf18516..fa9ed9ffa 100644 --- a/playbooks/deploy.yaml +++ b/playbooks/deploy.yaml @@ -1,20 +1,9 @@ --- - hosts: localhost connection: local - name: "Enroll hardware from baremetal.csv into Ironic" - sudo: yes - gather_facts: yes + name: "Provide deprecation notice" + sudo: no + gather_facts: no pre_tasks: - - name: "Error if variable baremetal_csv_file is not defined" - local_action: fail msg="baremetal_csv_file must be defined for this playbook to execute, please pass option '-e baremetal_csv_file='" - when: baremetal_csv_file is not defined - roles: - - role: bifrost-validate-host-for-deploy - baremetal_csv_file: "{{ baremetal_csv_file }}" -- hosts: localhost - connection: local - name: "Enroll hardware from baremetal.csv into Ironic" - gather_facts: yes - roles: - - role: bifrost-configdrives - - role: bifrost-setup-nodes + - name: "Error" + local_action: fail msg="Legacy roles have been removed. Please use dynamic inventory and deploy-dynamic.yaml" diff --git a/playbooks/enroll.yaml b/playbooks/enroll.yaml index 9677e6b63..2aa44106f 100644 --- a/playbooks/enroll.yaml +++ b/playbooks/enroll.yaml @@ -1,9 +1,9 @@ --- - hosts: localhost connection: local - name: "Enroll hardware from baremetal.csv into Ironic" - sudo: yes - gather_facts: yes - roles: - - role: ironic-enroll - baremetal_csv_file: "{{ baremetal_csv_file | mandatory }}" + name: "Provide deprecation notice" + sudo: no + gather_facts: no + pre_tasks: + - name: "Error" + local_action: fail msg="Legacy roles have been removed. Please use dynamic inventory and enroll-dynamic.yaml" diff --git a/playbooks/roles/bifrost-configdrives/README.md b/playbooks/roles/bifrost-configdrives/README.md deleted file mode 100644 index 488747e79..000000000 --- a/playbooks/roles/bifrost-configdrives/README.md +++ /dev/null @@ -1,70 +0,0 @@ -bifrost-configdrives -==================== - -Creates configdrives for nodes being provisioned in Bifrost. - -Requirements ------------- - -This playbook is intended to be executed prior to the deployments of nodes via the bifrost-setup-nodes role, as part of Bifrost. It creates a basic configuration drive containing network configuration and an SSH key permitting the user to login to the host. - -Role Variables --------------- - -This role, like the other deployment related bifrost playbooks are intended to be executed with the "baremetal_csv_file" variable which points to the file used to define the enrolled nodes that wish to be deployed upon. - -Additional key variables are: - -ipv4_subnet_mask: This is the subnet mask(e.g. 255.255.255.0 or similar) that matches the static addressing which desires to be imprinted into the configuration drive. -ipv4_gateway: This is the IPv4 default router address with-in the IPv4 subnet being utilized for IP addresses for the nodes being deployed. -node_default_network_interface: This is the default network interface with-in the nodes to be deployed which the new IP configuration will be applied to. Note: This is likely to be deprecated and removed in the future as Bifrost will likely change methods utilized to include networking configuration into the configuration drive sufficiently that this should no longer be required. -ipv4_nameserver: Defines the IPv4 Nameserver to configure the node with initially in order to support name resolution. -ssh_public_key_path: Defines the path to the file to be SSH public key to be inserted into the configuration drive. -ssh_public_key: If a user wishes to define an SSH public key as a string, this variable can be utilized which overrides ssh_public_key_path. - -Customizing ------------ - -The attempt with this playbook is to create a very simple and easily modifiable configuration drive to be loaded to the remote machine. This is naturally done each time the role is executed for every node defined in the baremetal_csv_file. If one wishes to insert additional files, this can be done by editing the tasks/main.yml file. As the drives are generated in a stepwise fashion, it is important to make note of and use the "{{item.split(',')[9]}}" variable as that is utilized to delineate the file destinations between different configuration drives. - -Additional detail on the format of configuration drives can be found at http://docs.openstack.org/user-guide/content/enable_config_drive.html. - -If one wishes to manually modify a configuration drive after the fact, the files are base64 encoded, gzip compressed, ISO9660 filesystems. Ironic will fail the deployment of the configuration drive if the file is not first found to be base64 encoded, and then gzip compressed. Alternatively, the configuration drive can be a vfat filesystem, although this carries with it some risks if the filesystem is always treated as a source of truth upon system boot. - -One final note. The size of the configuration drives is limited to 64MB. This is not a limit of Bifrost, but a limit due to the code utilized to write the configuration drive out. - -Dependencies ------------- - -This role is expected to be executed on a system that has had the ironic-install role executed upon it, however as the configuration drive creation step is fairly self contained, it can be executed as a separate step. - -Example Playbook ----------------- - -- hosts: localhost - connection: local - sudo: no - roles: - - role: bifrost-configdrives - -License -------- - -Copyright (c) 2015 Hewlett-Packard Development Company, L.P. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. - -Author Information ------------------- - -Ironic Developers diff --git a/playbooks/roles/bifrost-configdrives/defaults/main.yml b/playbooks/roles/bifrost-configdrives/defaults/main.yml deleted file mode 100644 index 66b494de4..000000000 --- a/playbooks/roles/bifrost-configdrives/defaults/main.yml +++ /dev/null @@ -1,2 +0,0 @@ ---- -# defaults file for bifrost-configdrives diff --git a/playbooks/roles/bifrost-configdrives/handlers/main.yml b/playbooks/roles/bifrost-configdrives/handlers/main.yml deleted file mode 100644 index 4ed0a58e2..000000000 --- a/playbooks/roles/bifrost-configdrives/handlers/main.yml +++ /dev/null @@ -1,2 +0,0 @@ ---- -# handlers file for bifrost-configdrives diff --git a/playbooks/roles/bifrost-configdrives/meta/main.yml b/playbooks/roles/bifrost-configdrives/meta/main.yml deleted file mode 100644 index 12893f0a8..000000000 --- a/playbooks/roles/bifrost-configdrives/meta/main.yml +++ /dev/null @@ -1,116 +0,0 @@ ---- -galaxy_info: - author: Ironic Developers - description: Creates a basic configdrive for Bifrost - company: OpenStack - license: Apache - min_ansible_version: 1.9 - # - # Below are all platforms currently available. Just uncomment - # the ones that apply to your role. If you don't see your - # platform on this list, let us know and we'll get it added! - # - platforms: - #- name: EL - # versions: - # - all - # - 5 - # - 6 - # - 7 - #- name: GenericUNIX - # versions: - # - all - # - any - #- name: Fedora - # versions: - # - all - # - 16 - # - 17 - # - 18 - # - 19 - # - 20 - #- name: SmartOS - # versions: - # - all - # - any - #- name: opensuse - # versions: - # - all - # - 12.1 - # - 12.2 - # - 12.3 - # - 13.1 - # - 13.2 - #- name: Amazon - # versions: - # - all - # - 2013.03 - # - 2013.09 - #- name: GenericBSD - # versions: - # - all - # - any - #- name: FreeBSD - # versions: - # - all - # - 8.0 - # - 8.1 - # - 8.2 - # - 8.3 - # - 8.4 - # - 9.0 - # - 9.1 - # - 9.1 - # - 9.2 - #- name: Ubuntu - # versions: - # - all - # - lucid - # - maverick - # - natty - # - oneiric - # - precise - # - quantal - # - raring - # - saucy - - trusty - #- name: SLES - # versions: - # - all - # - 10SP3 - # - 10SP4 - # - 11 - # - 11SP1 - # - 11SP2 - # - 11SP3 - #- name: GenericLinux - # versions: - # - all - # - any - #- name: Debian - # versions: - # - all - # - etch - # - lenny - # - squeeze - # - wheezy - # - # Below are all categories currently available. Just as with - # the platforms above, uncomment those that apply to your role. - # - categories: - - cloud - - cloud:openstack - #- cloud:gce - #- cloud:rax - #- clustering - #- database - #- database:nosql - #- database:sql - #- development - #- monitoring - #- networking - #- packaging - #- system - #- web -dependencies: [] diff --git a/playbooks/roles/bifrost-configdrives/tasks/main.yml b/playbooks/roles/bifrost-configdrives/tasks/main.yml deleted file mode 100644 index 52862ede7..000000000 --- a/playbooks/roles/bifrost-configdrives/tasks/main.yml +++ /dev/null @@ -1,66 +0,0 @@ -# Copyright (c) 2015 Hewlett-Packard Development Company, L.P. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. ---- -- name: "Identify ssh_public_key if ssh_public_key_path is defined" - include: ssh_public_key_path.yaml - when: ssh_public_key is undefined and ssh_public_key_path is defined -- name: "Name Make Temporary folder to build configdrive" - local_action: command mktemp -d - register: variable_configdrive_location -- name: "Make Metadata folder - /openstack/2012-08-10" - local_action: file state=directory name={{ variable_configdrive_location.stdout }}/{{item.split(',')[9]}}/openstack/2012-08-10/ - with_lines: - - cat {{ baremetal_csv_file }} -- name: "Make Metadata folder - /openstack/latest" - local_action: file state=directory name={{ variable_configdrive_location.stdout }}/{{item.split(',')[9]}}/openstack/latest/ - with_lines: - - cat {{ baremetal_csv_file }} -- name: "Place template in each openstack/2012-08-10 folder" - local_action: template src=openstack_meta_data.json.j2 dest={{ variable_configdrive_location.stdout }}/{{item.split(',')[9]}}/openstack/2012-08-10/meta_data.json - with_lines: - - cat {{ baremetal_csv_file }} -- name: "Place template in each openstack/latest folder" - local_action: template src=openstack_meta_data.json.j2 dest={{ variable_configdrive_location.stdout }}/{{item.split(',')[9]}}/openstack/latest/meta_data.json - with_lines: - - cat {{ baremetal_csv_file }} -- name: "Place network info template in each openstack/latest folder" - local_action: template src=network_info.json.j2 dest={{ variable_configdrive_location.stdout }}/{{item.split(',')[9]}}/openstack/latest/network_info.json - with_lines: - - cat {{ baremetal_csv_file }} -- name: "Make Metadata folder - /openstack/latest" - local_action: file state=directory name={{ variable_configdrive_location.stdout }}/{{item.split(',')[9]}}/openstack/content/ - with_lines: - - cat {{ baremetal_csv_file }} -- name: "Write network interface template" - local_action: template src=interfaces.j2 dest={{ variable_configdrive_location.stdout }}/{{item.split(',')[9]}}/openstack/content/0000 - with_lines: - - cat {{ baremetal_csv_file }} -- name: "Make config drive files" - sudo: yes - local_action: command mkisofs -R -V config-2 -o {{http_boot_folder}}/configdrive-{{item.split(',')[9]}}.iso {{ variable_configdrive_location.stdout }}/{{item.split(',')[9]}} - with_lines: - - cat {{ baremetal_csv_file }} -- name: "Make config drive files base64 encoded and gzip compressed" - sudo: yes - local_action: shell gzip -c {{http_boot_folder}}/configdrive-{{item.split(',')[9]}}.iso | base64 > {{http_boot_folder}}/configdrive-{{item.split(',')[9]}}.iso.gz - with_lines: - - cat {{ baremetal_csv_file }} -- name: "Cleanup configdrive .iso files" - sudo: yes - local_action: file state=absent name={{http_boot_folder}}/configdrive-{{item.split(',')[9]}}.iso - with_lines: - - cat {{ baremetal_csv_file }} -- name: "Cleanup configdrive temp folder" - sudo: yes - local_action: file state=absent force=yes name={{ variable_configdrive_location.stdout }} diff --git a/playbooks/roles/bifrost-configdrives/tasks/ssh_public_key_path.yaml b/playbooks/roles/bifrost-configdrives/tasks/ssh_public_key_path.yaml deleted file mode 100644 index ccfaff6e2..000000000 --- a/playbooks/roles/bifrost-configdrives/tasks/ssh_public_key_path.yaml +++ /dev/null @@ -1,23 +0,0 @@ -# Copyright (c) 2015 Hewlett-Packard Development Company, L.P. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. ---- -- name: "Defined ssh_public_key_path - Check to see if there is a file where the ssh_public_key_path is defined" - local_action: stat path={{ ssh_public_key_path }} - register: test_ssh_public_key_path - when: ssh_public_key_path is defined -- name: "Defined ssh_public_key_path - Error if ssh_public_key_path is not valid" - local_action: fail msg="ssh_public_key_path is not valid." - when: test_ssh_public_key_path.stat.exists == false -- name: "Defined ssh_public_key_path - Read ssh public key in" - set_fact: ssh_public_key="{{ lookup('file', ssh_public_key_path ) }}" diff --git a/playbooks/roles/bifrost-configdrives/templates/interfaces.j2 b/playbooks/roles/bifrost-configdrives/templates/interfaces.j2 deleted file mode 100644 index 462e04949..000000000 --- a/playbooks/roles/bifrost-configdrives/templates/interfaces.j2 +++ /dev/null @@ -1,10 +0,0 @@ -# interfaces(5) file used by ifup(8) and ifdown(8) -auto lo -iface lo inet loopback - -auto {{ node_default_network_interface }} -iface {{ node_default_network_interface }} inet static -address {{ item.split(',')[11] }} -netmask {{ ipv4_subnet_mask }} -gateway {{ ipv4_gateway }} -dns-nameservers {{ ipv4_nameserver }} diff --git a/playbooks/roles/bifrost-configdrives/templates/network_info.json.j2 b/playbooks/roles/bifrost-configdrives/templates/network_info.json.j2 deleted file mode 100644 index e0d4e759c..000000000 --- a/playbooks/roles/bifrost-configdrives/templates/network_info.json.j2 +++ /dev/null @@ -1,35 +0,0 @@ -{ -"links": [ - { - "id": "{{node_default_network_interface}}", - "type": "phy", - "ethernet_mac_address": "{{item.split(',')[0]}}", - "mtu":{{network_mtu}} - } -], -"networks": [ - { - "id": "publicnet-ipv", - "type": "ipv4", - "link": "{{ node_default_network_interface }}", - "ip_address": "{{item.split(',')[11]}}", - "netmask": "{{ipv4_subnet_mask}}", - "dns_nameservers": [ - "{{ipv4_nameserver}}" - ], - "routes": [ - { - "network": "0.0.0.0", - "netmask": "0.0.0.0", - "gateway": "{{ipv4_gateway}}" - } - ] - } -], -"services": [ - { - "type": "dns", - "address": "{{ipv4_nameserver}}" - } -] -} diff --git a/playbooks/roles/bifrost-configdrives/templates/openstack_meta_data.json.j2 b/playbooks/roles/bifrost-configdrives/templates/openstack_meta_data.json.j2 deleted file mode 100644 index 874ef0157..000000000 --- a/playbooks/roles/bifrost-configdrives/templates/openstack_meta_data.json.j2 +++ /dev/null @@ -1,16 +0,0 @@ -{ - "availability_zone": "", - "files": [ - { - "content_path": "/content/0000", - "path": "/etc/network/interfaces" - } - ], - "hostname": "{{item.split(',')[10]}}", - "name": "{{item.split(',')[10]}}", - "meta": {}, - "public_keys": { - "mykey": "{{ ssh_public_key }}" - }, - "uuid": "{{item.split(',')[9]}}" -} diff --git a/playbooks/roles/bifrost-configdrives/vars/main.yml b/playbooks/roles/bifrost-configdrives/vars/main.yml deleted file mode 100644 index 13580d052..000000000 --- a/playbooks/roles/bifrost-configdrives/vars/main.yml +++ /dev/null @@ -1,2 +0,0 @@ ---- -# vars file for bifrost-configdrives diff --git a/playbooks/roles/bifrost-prepare-for-test/README.md b/playbooks/roles/bifrost-prepare-for-test/README.md deleted file mode 100644 index ef77e9108..000000000 --- a/playbooks/roles/bifrost-prepare-for-test/README.md +++ /dev/null @@ -1,56 +0,0 @@ -bifrost-prepare-for-test -======================== - -Enrolls nodes that have been stood up by the deployment module in Bifrost, into the in-memory inventory for basic testing as hosts in the testvm group. - -Requirements ------------- - -This role requires the baremetal_csv_file variable which is utilized to add entries to the in-memory inventory. - -Role Variables --------------- - -baremetal_csv_file: This is the CSV file that defines the list of nodes to enroll and deploy as part of Bifrost. - -Dependencies ------------- - -This role is dependent upon an environment having been installed with the install-ironic role, as well as by the bifrost-config-drives and bifrost-setup-nodes roles. - -As this role is purely for testing, dependencies are not hard coded into the role. - -Example Playbook ----------------- - -- hosts: localhost - connection: local - name: "Executes install, enrollment, and testing in one playbook" - sudo: no - gather_facts: yes - roles: - - role: bifrost-configdrives - - role: bifrost-setup-nodes - - role: bifrost-prepare-for-test - -License -------- - -Copyright (c) 2015 Hewlett-Packard Development Company, L.P. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. - -Author Information ------------------- - -Ironic Developers diff --git a/playbooks/roles/bifrost-prepare-for-test/defaults/main.yml b/playbooks/roles/bifrost-prepare-for-test/defaults/main.yml deleted file mode 100644 index 18feb30f5..000000000 --- a/playbooks/roles/bifrost-prepare-for-test/defaults/main.yml +++ /dev/null @@ -1,2 +0,0 @@ ---- -# defaults file for bifrost-prepare-for-test diff --git a/playbooks/roles/bifrost-prepare-for-test/handlers/main.yml b/playbooks/roles/bifrost-prepare-for-test/handlers/main.yml deleted file mode 100644 index 2854357d2..000000000 --- a/playbooks/roles/bifrost-prepare-for-test/handlers/main.yml +++ /dev/null @@ -1,2 +0,0 @@ ---- -# handlers file for bifrost-prepare-for-test diff --git a/playbooks/roles/bifrost-prepare-for-test/meta/main.yml b/playbooks/roles/bifrost-prepare-for-test/meta/main.yml deleted file mode 100644 index 7aae2da7d..000000000 --- a/playbooks/roles/bifrost-prepare-for-test/meta/main.yml +++ /dev/null @@ -1,116 +0,0 @@ ---- -galaxy_info: - author: Ironic Developers - description: Prepare for basic bifrost testing. - company: OpenStack - license: Apache - min_ansible_version: 1.9 - # - # Below are all platforms currently available. Just uncomment - # the ones that apply to your role. If you don't see your - # platform on this list, let us know and we'll get it added! - # - platforms: - #- name: EL - # versions: - # - all - # - 5 - # - 6 - # - 7 - #- name: GenericUNIX - # versions: - # - all - # - any - #- name: Fedora - # versions: - # - all - # - 16 - # - 17 - # - 18 - # - 19 - # - 20 - #- name: SmartOS - # versions: - # - all - # - any - #- name: opensuse - # versions: - # - all - # - 12.1 - # - 12.2 - # - 12.3 - # - 13.1 - # - 13.2 - #- name: Amazon - # versions: - # - all - # - 2013.03 - # - 2013.09 - #- name: GenericBSD - # versions: - # - all - # - any - #- name: FreeBSD - # versions: - # - all - # - 8.0 - # - 8.1 - # - 8.2 - # - 8.3 - # - 8.4 - # - 9.0 - # - 9.1 - # - 9.1 - # - 9.2 - #- name: Ubuntu - # versions: - # - all - # - lucid - # - maverick - # - natty - # - oneiric - # - precise - # - quantal - # - raring - # - saucy - - trusty - #- name: SLES - # versions: - # - all - # - 10SP3 - # - 10SP4 - # - 11 - # - 11SP1 - # - 11SP2 - # - 11SP3 - #- name: GenericLinux - # versions: - # - all - # - any - #- name: Debian - # versions: - # - all - # - etch - # - lenny - # - squeeze - # - wheezy - # - # Below are all categories currently available. Just as with - # the platforms above, uncomment those that apply to your role. - # - categories: - - cloud - - cloud:openstack - #- cloud:gce - #- cloud:rax - #- clustering - #- database - #- database:nosql - #- database:sql - #- development - #- monitoring - #- networking - #- packaging - #- system - #- web -dependencies: [] diff --git a/playbooks/roles/bifrost-prepare-for-test/tasks/main.yml b/playbooks/roles/bifrost-prepare-for-test/tasks/main.yml deleted file mode 100644 index ffb0499b1..000000000 --- a/playbooks/roles/bifrost-prepare-for-test/tasks/main.yml +++ /dev/null @@ -1,34 +0,0 @@ -# Copyright (c) 2015 Hewlett-Packard Development Company, L.P. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. ---- -- name: "Waiting for the base testvm machine to become available." - wait_for: state=started port=22 host={{ item.split(',')[11] }} timeout=900 - with_lines: - - cat {{ baremetal_csv_file }} -- name: "Pausing for 4 seconds to allow testvm to become fully operational and to avoid any potential sshd startup race." - # NOTE(TheJulia): AFAIK sshd opens it's socket and then loads/generates - # keys, which can become visible as a race, hence the four second pause. - pause: seconds=4 -- name: "Adding testvms to Ansible Inventory" - add_host: name="{{ item.split(',')[11] }}:22" groups=testvm - with_lines: - - cat {{ baremetal_csv_file }} -- name: "Removing testvm hosts from ssh known_hosts file." - command: ssh-keygen -R "{{ item.split(',')[11] }}" - with_lines: - - cat {{ baremetal_csv_file }} -- name: "Adding testvm hosts from ssh known_hosts file." - shell: ssh-keyscan "{{ item.split(',')[11] }}" >> "{{ ansible_env.HOME }}/.ssh/known_hosts" - with_lines: - - cat {{ baremetal_csv_file }} diff --git a/playbooks/roles/bifrost-prepare-for-test/vars/main.yml b/playbooks/roles/bifrost-prepare-for-test/vars/main.yml deleted file mode 100644 index 3d41d66f1..000000000 --- a/playbooks/roles/bifrost-prepare-for-test/vars/main.yml +++ /dev/null @@ -1,4 +0,0 @@ ---- -cleaning: false -testing: true -baremetal_csv_file: "/tmp/baremetal.csv" diff --git a/playbooks/roles/bifrost-unprovision-nodes/README.md b/playbooks/roles/bifrost-unprovision-nodes/README.md deleted file mode 100644 index e43c4c412..000000000 --- a/playbooks/roles/bifrost-unprovision-nodes/README.md +++ /dev/null @@ -1,57 +0,0 @@ -bifrost-unprovision-nodes -========================= - -This role unprovisions nodes. Essentially calls `ironic node-set-provisioned-state deleted` - - -Requirements ------------- - -An enrolled node, and a baremetal.csv file provided via the environment variable baremetal_csv_file. - -The os_ironic_node module is required. - -Role Variables --------------- - -baremetal_csv_file: This is the path to the CSV file which is enumerated through for nodes to be acted upon. - -ironic_url: The setting defining the URL to the Ironic API. Presently defaulted to: "http://localhost:6385/" - -Dependencies ------------- - -This role has no roles that it is directly dependent upon directly, but expects that the environment has been installed with the ironic-install role. - -Example Playbook ----------------- - -- hosts: localhost - connection: local - name: "Unprovisions the test node" - sudo: no - gather_facts: no - roles: - - role: bifrost-unprovision-nodes - -License -------- - -Copyright (c) 2015 Hewlett-Packard Development Company, L.P. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. - -Author Information ------------------- - -Ironic Developers diff --git a/playbooks/roles/bifrost-unprovision-nodes/defaults/main.yml b/playbooks/roles/bifrost-unprovision-nodes/defaults/main.yml deleted file mode 100644 index 44445bba9..000000000 --- a/playbooks/roles/bifrost-unprovision-nodes/defaults/main.yml +++ /dev/null @@ -1,2 +0,0 @@ ---- -ironic_url: "http://localhost:6385/" diff --git a/playbooks/roles/bifrost-unprovision-nodes/handlers/main.yml b/playbooks/roles/bifrost-unprovision-nodes/handlers/main.yml deleted file mode 100644 index 69f92c4d6..000000000 --- a/playbooks/roles/bifrost-unprovision-nodes/handlers/main.yml +++ /dev/null @@ -1,2 +0,0 @@ ---- -# handlers file for bifrost-unprovision-nodes diff --git a/playbooks/roles/bifrost-unprovision-nodes/meta/main.yml b/playbooks/roles/bifrost-unprovision-nodes/meta/main.yml deleted file mode 100644 index 0c7e9ec65..000000000 --- a/playbooks/roles/bifrost-unprovision-nodes/meta/main.yml +++ /dev/null @@ -1,116 +0,0 @@ ---- -galaxy_info: - author: Ironic Developers - description: Unprovisions nodes in Ironic - company: OpenStack - license: Apache - min_ansible_version: 2.0 - # - # Below are all platforms currently available. Just uncomment - # the ones that apply to your role. If you don't see your - # platform on this list, let us know and we'll get it added! - # - platforms: - #- name: EL - # versions: - # - all - # - 5 - # - 6 - # - 7 - #- name: GenericUNIX - # versions: - # - all - # - any - #- name: Fedora - # versions: - # - all - # - 16 - # - 17 - # - 18 - # - 19 - # - 20 - #- name: SmartOS - # versions: - # - all - # - any - #- name: opensuse - # versions: - # - all - # - 12.1 - # - 12.2 - # - 12.3 - # - 13.1 - # - 13.2 - #- name: Amazon - # versions: - # - all - # - 2013.03 - # - 2013.09 - #- name: GenericBSD - # versions: - # - all - # - any - #- name: FreeBSD - # versions: - # - all - # - 8.0 - # - 8.1 - # - 8.2 - # - 8.3 - # - 8.4 - # - 9.0 - # - 9.1 - # - 9.1 - # - 9.2 - #- name: Ubuntu - # versions: - # - all - # - lucid - # - maverick - # - natty - # - oneiric - # - precise - # - quantal - # - raring - # - saucy - - trusty - #- name: SLES - # versions: - # - all - # - 10SP3 - # - 10SP4 - # - 11 - # - 11SP1 - # - 11SP2 - # - 11SP3 - #- name: GenericLinux - # versions: - # - all - # - any - #- name: Debian - # versions: - # - all - # - etch - # - lenny - # - squeeze - # - wheezy - # - # Below are all categories currently available. Just as with - # the platforms above, uncomment those that apply to your role. - # - categories: - - cloud - - cloud:openstack - #- cloud:gce - #- cloud:rax - #- clustering - #- database - #- database:nosql - #- database:sql - #- development - #- monitoring - #- networking - #- packaging - #- system - #- web -dependencies: [] diff --git a/playbooks/roles/bifrost-unprovision-nodes/tasks/main.yml b/playbooks/roles/bifrost-unprovision-nodes/tasks/main.yml deleted file mode 100644 index 257b622c2..000000000 --- a/playbooks/roles/bifrost-unprovision-nodes/tasks/main.yml +++ /dev/null @@ -1,25 +0,0 @@ -# Copyright (c) 2015 Hewlett-Packard Development Company, L.P. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. ---- -- name: "Unprovision node" - os_ironic_node: - auth_type: None - auth: None - ironic_url: "{{ ironic_url }}" - uuid: "{{item.split(',')[9]}}" - state: absent - instance_info: "{}" - delegate_to: localhost - with_lines: - - cat {{ baremetal_csv_file }} diff --git a/playbooks/roles/bifrost-unprovision-nodes/vars/main.yml b/playbooks/roles/bifrost-unprovision-nodes/vars/main.yml deleted file mode 100644 index afad72860..000000000 --- a/playbooks/roles/bifrost-unprovision-nodes/vars/main.yml +++ /dev/null @@ -1,2 +0,0 @@ ---- -# vars file for bifrost-unprovision-nodes diff --git a/playbooks/roles/ironic-delete/README.md b/playbooks/roles/ironic-delete/README.md deleted file mode 100644 index e1a3a18e4..000000000 --- a/playbooks/roles/ironic-delete/README.md +++ /dev/null @@ -1,54 +0,0 @@ -ironic-delete -============= - -Removes nodes from Ironic utilizing the os_ironic Ansible module that is installed by Bifrost. - -Requirements ------------- - -This role expects an environment installed with ironic-install role, although the os_ironic ansible module and baremetal_csv_file variable are ultimately required. - -Role Variables --------------- - -baremetal_csv_file: This is the CSV file of nodes that is enumerated through for operations. - -ironic_url: This is the url for the ironic server to connect to. It is presently defaulted to "http://localhost:6385/". - -Dependencies ------------- - -This role has no direct role dependencies although is expected to be executed as part of Bifrost's test sequence. - -Example Playbook ----------------- - -- hosts: localhost - connection: local - name: "Unprovisions the test node" - sudo: no - gather_facts: no - roles: - - role: ironic-delete - -License -------- - -Copyright (c) 2015 Hewlett-Packard Development Company, L.P. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. - -Author Information ------------------- - -Ironic Developers diff --git a/playbooks/roles/ironic-delete/defaults/main.yml b/playbooks/roles/ironic-delete/defaults/main.yml deleted file mode 100644 index 44445bba9..000000000 --- a/playbooks/roles/ironic-delete/defaults/main.yml +++ /dev/null @@ -1,2 +0,0 @@ ---- -ironic_url: "http://localhost:6385/" diff --git a/playbooks/roles/ironic-delete/handlers/main.yml b/playbooks/roles/ironic-delete/handlers/main.yml deleted file mode 100644 index 8a867ace2..000000000 --- a/playbooks/roles/ironic-delete/handlers/main.yml +++ /dev/null @@ -1,2 +0,0 @@ ---- -# handlers file for ironic-delete diff --git a/playbooks/roles/ironic-delete/meta/main.yml b/playbooks/roles/ironic-delete/meta/main.yml deleted file mode 100644 index 2df7d5986..000000000 --- a/playbooks/roles/ironic-delete/meta/main.yml +++ /dev/null @@ -1,116 +0,0 @@ ---- -galaxy_info: - author: Ironic Developers - description: Removes enrolled nodes from Ironic - company: OpenStack - license: Apache - min_ansible_version: 2.0 - # - # Below are all platforms currently available. Just uncomment - # the ones that apply to your role. If you don't see your - # platform on this list, let us know and we'll get it added! - # - platforms: - #- name: EL - # versions: - # - all - # - 5 - # - 6 - # - 7 - #- name: GenericUNIX - # versions: - # - all - # - any - #- name: Fedora - # versions: - # - all - # - 16 - # - 17 - # - 18 - # - 19 - # - 20 - #- name: SmartOS - # versions: - # - all - # - any - #- name: opensuse - # versions: - # - all - # - 12.1 - # - 12.2 - # - 12.3 - # - 13.1 - # - 13.2 - #- name: Amazon - # versions: - # - all - # - 2013.03 - # - 2013.09 - #- name: GenericBSD - # versions: - # - all - # - any - #- name: FreeBSD - # versions: - # - all - # - 8.0 - # - 8.1 - # - 8.2 - # - 8.3 - # - 8.4 - # - 9.0 - # - 9.1 - # - 9.1 - # - 9.2 - #- name: Ubuntu - # versions: - # - all - # - lucid - # - maverick - # - natty - # - oneiric - # - precise - # - quantal - # - raring - # - saucy - - trusty - #- name: SLES - # versions: - # - all - # - 10SP3 - # - 10SP4 - # - 11 - # - 11SP1 - # - 11SP2 - # - 11SP3 - #- name: GenericLinux - # versions: - # - all - # - any - #- name: Debian - # versions: - # - all - # - etch - # - lenny - # - squeeze - # - wheezy - # - # Below are all categories currently available. Just as with - # the platforms above, uncomment those that apply to your role. - # - categories: - - cloud - - cloud:openstack - #- cloud:gce - #- cloud:rax - #- clustering - #- database - #- database:nosql - #- database:sql - #- development - #- monitoring - #- networking - #- packaging - #- system - #- web -dependencies: [] diff --git a/playbooks/roles/ironic-delete/tasks/main.yml b/playbooks/roles/ironic-delete/tasks/main.yml deleted file mode 100644 index b650ca61b..000000000 --- a/playbooks/roles/ironic-delete/tasks/main.yml +++ /dev/null @@ -1,37 +0,0 @@ -# Copyright (c) 2015 Hewlett-Packard Development Company, L.P. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. ---- -- name: "Error if variable baremetal_csv_file is not defined" - fail: msg="baremetal_csv_file must be defined for this playbook to execute, please pass option '-e baremetal_csv_file='" - when: baremetal_csv_file is not defined -- name: "Validate that CSV file exists" - stat: path={{ baremetal_csv_file }} - register: test_baremetal_csv_file -- name: "Error if file does not exist." - fail: msg="The variable defined for baremetal_csv_file is not to a file. Please define a file and try again." - when: test_baremetal_csv_file.stat.isreg == false -- name: "Delete Hardware" - os_ironic: - auth_type: None - auth: None - ironic_url: "{{ ironic_url }}" - driver: "agent_ipmitool" - uuid: "{{item.split(',')[9]}}" - state: absent - nics: - - mac: "{{item.split(',')[0]}}" - driver_info: "{}" - delegate_to: localhost - with_lines: - - cat {{ baremetal_csv_file }} diff --git a/playbooks/roles/ironic-delete/vars/main.yml b/playbooks/roles/ironic-delete/vars/main.yml deleted file mode 100644 index 77321d700..000000000 --- a/playbooks/roles/ironic-delete/vars/main.yml +++ /dev/null @@ -1,2 +0,0 @@ ---- -# vars file for ironic-delete diff --git a/playbooks/roles/ironic-enroll/README.md b/playbooks/roles/ironic-enroll/README.md deleted file mode 100644 index b5524b9c8..000000000 --- a/playbooks/roles/ironic-enroll/README.md +++ /dev/null @@ -1,79 +0,0 @@ -ironic-enroll -============= - -Enrolls nodes into Ironic utilizing the os_ironic Ansible module that is installed by Bifrost. - -Requirements ------------- - -This role is dependent upon the os-ironic ansible module, which is dependent upon shade (https://git.openstack.org/cgit/openstack-infra/shade), which in this case is presently dependent upon the Ironic Python Client Library (http://git.openstack.org/cgit/openstack/python-ironicclient/). - -Role Variables --------------- - -baremetal_csv_file: This variable is the path to a CSV file which contains a list of nodes to enroll into Ironic. This file has a particular format based on columns, which will be listed below, however the base playbooks are easily modifiable to utilize less information as some of the information is not presently required. - -The CSV file has the following columns: - -0. MAC Address -1. Management username -2. Management password -3. Management Address -4. CPU Count -5. Memory size in MB -6. Disk Storage in GB -7. Flavor (Not Used) -8. Type (Not Used) -9. Host UUID -10. Host or Node name -11. Host IP Address to be set -12. ipmi_target_channel - Requires: ipmi_bridging set to single -13. ipmi_target_address - Requires: ipmi_bridging set to single -14. ipmi_transit_channel - Requires: ipmi_bridging set to dual -15. ipmi_transit_address - Requires: ipmi_bridging set to dual - -testing: This setting coupled with the previously mentioned baremetal_csv_file enrolls all nodes defined in the baremetal.csv file utilizing the Ironic agent_ssh driver instead of the agent_ipmitool driver which Bifrost uses by default. The default setting for this role is false. - -ipmi_bridging: The setting is by default undefined, and is utilized when access to a host's IPMI interface is bridged, such as a cartridge or blade in a chassis that has a single management address. It has two options when defined, "single" or "dual", and is utilized to execute the appropriate task in order to feed the appropriate IPMI bridging information based on the CSV file into Ironic. - -ironic_url: The setting defining the URL to the Ironic API. Presently defaulted to: "http://localhost:6385/" - -Dependencies ------------- - -This role is presently dependent upon the ironic-install role which installs the necessary requirements. - -Example Playbook ----------------- - -- hosts: localhost - connection: local - gather_facts: yes - pre_tasks: - - set_fact: baremetal_csv_file="/tmp/baremetal.csv" - when: baremetal_csv_file is not defined - roles: - - role: ironic-enroll - testing: true - -License -------- - -Copyright (c) 2015 Hewlett-Packard Development Company, L.P. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. - -Author Information ------------------- - -Ironic Developers diff --git a/playbooks/roles/ironic-enroll/defaults/main.yml b/playbooks/roles/ironic-enroll/defaults/main.yml deleted file mode 100644 index 3615fb578..000000000 --- a/playbooks/roles/ironic-enroll/defaults/main.yml +++ /dev/null @@ -1,4 +0,0 @@ ---- -ipmi_bridging: "no" -testing: false -ironic_url: "http://localhost:6385/" diff --git a/playbooks/roles/ironic-enroll/handlers/main.yml b/playbooks/roles/ironic-enroll/handlers/main.yml deleted file mode 100644 index c076eabf4..000000000 --- a/playbooks/roles/ironic-enroll/handlers/main.yml +++ /dev/null @@ -1,2 +0,0 @@ ---- -# handlers file for ironic-enroll diff --git a/playbooks/roles/ironic-enroll/meta/main.yml b/playbooks/roles/ironic-enroll/meta/main.yml deleted file mode 100644 index 1c9b0dfea..000000000 --- a/playbooks/roles/ironic-enroll/meta/main.yml +++ /dev/null @@ -1,116 +0,0 @@ ---- -galaxy_info: - author: Ironic Developers - description: Enrolls nodes into Ironic - company: OpenStack - license: Apache - min_ansible_version: 2.0 - # - # Below are all platforms currently available. Just uncomment - # the ones that apply to your role. If you don't see your - # platform on this list, let us know and we'll get it added! - # - platforms: - #- name: EL - # versions: - # - all - # - 5 - # - 6 - # - 7 - #- name: GenericUNIX - # versions: - # - all - # - any - #- name: Fedora - # versions: - # - all - # - 16 - # - 17 - # - 18 - # - 19 - # - 20 - #- name: SmartOS - # versions: - # - all - # - any - #- name: opensuse - # versions: - # - all - # - 12.1 - # - 12.2 - # - 12.3 - # - 13.1 - # - 13.2 - #- name: Amazon - # versions: - # - all - # - 2013.03 - # - 2013.09 - #- name: GenericBSD - # versions: - # - all - # - any - #- name: FreeBSD - # versions: - # - all - # - 8.0 - # - 8.1 - # - 8.2 - # - 8.3 - # - 8.4 - # - 9.0 - # - 9.1 - # - 9.1 - # - 9.2 - #- name: Ubuntu - # versions: - # - all - # - lucid - # - maverick - # - natty - # - oneiric - # - precise - # - quantal - # - raring - # - saucy - - trusty - #- name: SLES - # versions: - # - all - # - 10SP3 - # - 10SP4 - # - 11 - # - 11SP1 - # - 11SP2 - # - 11SP3 - #- name: GenericLinux - # versions: - # - all - # - any - #- name: Debian - # versions: - # - all - # - etch - # - lenny - # - squeeze - # - wheezy - # - # Below are all categories currently available. Just as with - # the platforms above, uncomment those that apply to your role. - # - categories: - - cloud - - cloud:openstack - #- cloud:gce - #- cloud:rax - #- clustering - #- database - #- database:nosql - #- database:sql - #- development - #- monitoring - #- networking - #- packaging - #- system - #- web -dependencies: [] diff --git a/playbooks/roles/ironic-enroll/tasks/ipmi_bridging_dual_enroll.yaml b/playbooks/roles/ironic-enroll/tasks/ipmi_bridging_dual_enroll.yaml deleted file mode 100644 index c63203495..000000000 --- a/playbooks/roles/ironic-enroll/tasks/ipmi_bridging_dual_enroll.yaml +++ /dev/null @@ -1,64 +0,0 @@ -# Copyright (c) 2015 Hewlett-Packard Development Company, L.P. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. ---- -- name: "Enroll Hardware" - # The variable definitions below seem far from ideal, however there - # seems to be no better way to handle CSV files for looping at this time. - # - # Ideally with_lines would be used with an include, however that support was removed in - # Ansible 1.6 and no direct replacement exists. - # - # mac_address: "{{item.split(',')[1]}}" - # username: "{{item.split(',')[2]}}" - # password: "{{item.split(',')[3]}}" - # management_address: "{{item.split(',')[4]}}" - # cpu_cores: "{{item.split(',')[5]}}" - # memory_MB: "{{item.split(',')[6]}}" - # disk_MB: "{{item.split(',')[7]}}" - # ipmi_target_channel: "{{item.split(',')[12]}}" - # ipmi_target_address: "{{item.split(',')[13]}}" - # ipmi_transit_channel: "{{item.split(',')[14]}}" - # ipmi_transit_address: "{{item.split(',')[15]}}" - # - os_ironic: - auth_type: None - auth: None - ironic_url: "{{ ironic_url }}" - driver: "agent_ipmitool" - # UUID determination TBD for mass enrollment. - uuid: "{{item.split(',')[9]}}" - state: present - nics: - - mac: "{{item.split(',')[0]}}" - properties: - cpus: "{{item.split(',')[4]}}" - cpu_arch: "x86_64" - ram: "{{item.split(',')[5]}}" - disk_size: "{{item.split(',')[6]}}" - driver_info: - power: - ipmi_address: "{{item.split(',')[3]}}" - ipmi_username: "{{item.split(',')[1]}}" - ipmi_password: "{{item.split(',')[2]}}" - ipmi_bridging: "dual" - ipmi_target_channel: "{{item.split(',')[12]}}" - ipmi_target_address: "{{item.split(',')[13]}}" - ipmi_transit_channel: "{{item.split(',')[14]}}" - ipmi_transit_address: "{{item.split(',')[15]}}" - deploy: - deploy_kernel: "{{ deploy_kernel_url }}" - deploy_ramdisk: "{{ deploy_ramdisk_url }}" - delegate_to: localhost - with_lines: - - cat {{ baremetal_csv_file }} diff --git a/playbooks/roles/ironic-enroll/tasks/ipmi_bridging_single_enroll.yaml b/playbooks/roles/ironic-enroll/tasks/ipmi_bridging_single_enroll.yaml deleted file mode 100644 index d236c8000..000000000 --- a/playbooks/roles/ironic-enroll/tasks/ipmi_bridging_single_enroll.yaml +++ /dev/null @@ -1,59 +0,0 @@ -# Copyright (c) 2015 Hewlett-Packard Development Company, L.P. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. ---- -- name: "Enroll Hardware" - # The variable definitions below seem far from ideal, however there - # seems to be no better way to handle CSV files for looping at this time. - # - # Ideally with_lines would be used with an include, however that support was removed in - # Ansible 1.6 and no direct replacement exists. - # - # mac_address: "{{item.split(',')[1]}}" - # username: "{{item.split(',')[2]}}" - # password: "{{item.split(',')[3]}}" - # management_address: "{{item.split(',')[4]}}" - # cpu_cores: "{{item.split(',')[5]}}" - # memory_MB: "{{item.split(',')[6]}}" - # disk_MB: "{{item.split(',')[7]}}" - # ipmi_target_channel: "{{item.split(',')[12]}}" - # ipmi_target_address: "{{item.split(',')[13]}}" - os_ironic: - auth_type: None - auth: None - ironic_url: "{{ ironic_url }}" - driver: "agent_ipmitool" - # UUID determination TBD for mass enrollment. - uuid: "{{item.split(',')[9]}}" - state: present - nics: - - mac: "{{item.split(',')[0]}}" - properties: - cpus: "{{item.split(',')[4]}}" - cpu_arch: "x86_64" - ram: "{{item.split(',')[5]}}" - disk_size: "{{item.split(',')[6]}}" - driver_info: - power: - ipmi_address: "{{item.split(',')[3]}}" - ipmi_username: "{{item.split(',')[1]}}" - ipmi_password: "{{item.split(',')[2]}}" - ipmi_bridging: "single" - ipmi_target_channel: "{{item.split(',')[12]}}" - ipmi_target_address: "{{item.split(',')[13]}}" - deploy: - deploy_kernel: "{{ deploy_kernel_url }}" - deploy_ramdisk: "{{ deploy_ramdisk_url }}" - delegate_to: localhost - with_lines: - - cat {{ baremetal_csv_file }} diff --git a/playbooks/roles/ironic-enroll/tasks/main.yml b/playbooks/roles/ironic-enroll/tasks/main.yml deleted file mode 100644 index 1d2f09443..000000000 --- a/playbooks/roles/ironic-enroll/tasks/main.yml +++ /dev/null @@ -1,35 +0,0 @@ -# Copyright (c) 2015 Hewlett-Packard Development Company, L.P. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. ---- -- name: "Error if variable baremetal_csv_file is not defined" - fail: msg="baremetal_csv_file must be defined for this playbook to execute, please pass option '-e baremetal_csv_file='" - when: baremetal_csv_file is not defined -- name: "Validate that CSV file exists" - stat: path={{ baremetal_csv_file }} - register: test_baremetal_csv_file -- name: "Error if file does not exist." - fail: msg="The variable defined for baremetal_csv_file is not to a file. Please define a file and try again." - when: test_baremetal_csv_file.stat.isreg == false -- name: "If testing, enroll virtual machines." - include: virtual_enroll.yaml - when: testing == true -- name: "If no ipmi_bridging value set, or a value of no exists, execute standard sequence." - include: standard_enroll.yaml - when: (ipmi_bridging != "single" and ipmi_bridging != "dual") and (testing != true ) -- name: "If ipmi_bridging is set to single, execute single bridge enrollment sequence.." - include: ipmi_bridging_single_enroll.yaml - when: testing != true and (ipmi_bridging is defined and ipmi_bridging == "single") -- name: "If ipmi_bridging is set to single, execute dual bridge enrollment sequence.." - include: ipmi_bridging_dual_enroll.yaml - when: testing != true and (ipmi_bridging is defined and ipmi_bridging == "dual") diff --git a/playbooks/roles/ironic-enroll/tasks/standard_enroll.yaml b/playbooks/roles/ironic-enroll/tasks/standard_enroll.yaml deleted file mode 100644 index 35cb5c7e1..000000000 --- a/playbooks/roles/ironic-enroll/tasks/standard_enroll.yaml +++ /dev/null @@ -1,54 +0,0 @@ -# Copyright (c) 2015 Hewlett-Packard Development Company, L.P. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. ---- -- name: "Enroll Hardware" - # The variable definitions below seem far from ideal, however there - # seems to be no better way to handle CSV files for looping at this time. - # - # Ideally with_lines would be used with an include, however that support was removed in - # Ansible 1.6 and no direct replacement exists. - # - # mac_address: "{{item.split(',')[1]}}" - # username: "{{item.split(',')[2]}}" - # password: "{{item.split(',')[3]}}" - # management_address: "{{item.split(',')[4]}}" - # cpu_cores: "{{item.split(',')[5]}}" - # memory_MB: "{{item.split(',')[6]}}" - # disk_MB: "{{item.split(',')[7]}}" - os_ironic: - auth_type: None - auth: None - ironic_url: "{{ ironic_url }}" - driver: "agent_ipmitool" - # UUID determination TBD for mass enrollment. - uuid: "{{item.split(',')[9]}}" - state: present - nics: - - mac: "{{item.split(',')[0]}}" - properties: - cpus: "{{item.split(',')[4]}}" - cpu_arch: "x86_64" - ram: "{{item.split(',')[5]}}" - disk_size: "{{item.split(',')[6]}}" - driver_info: - power: - ipmi_address: "{{item.split(',')[3]}}" - ipmi_username: "{{item.split(',')[1]}}" - ipmi_password: "{{item.split(',')[2]}}" - deploy: - deploy_kernel: "{{ deploy_kernel_url }}" - deploy_ramdisk: "{{ deploy_ramdisk_url }}" - delegate_to: localhost - with_lines: - - cat {{ baremetal_csv_file }} diff --git a/playbooks/roles/ironic-enroll/tasks/virtual_enroll.yaml b/playbooks/roles/ironic-enroll/tasks/virtual_enroll.yaml deleted file mode 100644 index a7677e44a..000000000 --- a/playbooks/roles/ironic-enroll/tasks/virtual_enroll.yaml +++ /dev/null @@ -1,56 +0,0 @@ -# Copyright (c) 2015 Hewlett-Packard Development Company, L.P. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ---- -- name: "Enroll Virtual Machines" - os_ironic: - # The variable definitions below seem far from ideal, however there - # seems to be no better way to handle CSV files for looping at this time. - # - # Ideally with_lines would be used with an include, however that support was removed in - # Ansible 1.6 and no direct replacement exists. - # - # mac_address: "{{item.split(',')[1]}}" - # username: "{{item.split(',')[2]}}" - # password: "{{item.split(',')[3]}}" - # management_address: "{{item.split(',')[4]}}" - # cpu_cores: "{{item.split(',')[5]}}" - # memory_MB: "{{item.split(',')[6]}}" - # disk_MB: "{{item.split(',')[7]}}" - auth_type: None - auth: None - ironic_url: "{{ ironic_url }}" - driver: "agent_ssh" - uuid: "{{item.split(',')[9]}}" - state: present - nics: - - mac: "{{item.split(',')[0]}}" - properties: - cpus: "{{item.split(',')[4]}}" - cpu_arch: "x86_64" - ram: "{{item.split(',')[5]}}" - disk_size: "{{item.split(',')[6]}}" - driver_info: - power: - ssh_virt_type: "virsh" - ssh_address: 127.0.0.1 - ssh_port: 22 - ssh_username: ironic - ssh_key_filename: /home/ironic/.ssh/id_rsa - deploy: - deploy_kernel: "{{ deploy_kernel_url }}" - deploy_ramdisk: "{{ deploy_ramdisk_url }}" - delegate_to: localhost - with_lines: - - cat {{ baremetal_csv_file }} diff --git a/playbooks/roles/ironic-enroll/vars/main.yml b/playbooks/roles/ironic-enroll/vars/main.yml deleted file mode 100644 index e742b5e59..000000000 --- a/playbooks/roles/ironic-enroll/vars/main.yml +++ /dev/null @@ -1,2 +0,0 @@ ---- -# vars file for ironic-enroll diff --git a/playbooks/test-bifrost.yaml b/playbooks/test-bifrost.yaml deleted file mode 100644 index d78569b90..000000000 --- a/playbooks/test-bifrost.yaml +++ /dev/null @@ -1,76 +0,0 @@ ---- -- hosts: localhost - connection: local - name: "Executes install, enrollment, and testing in one playbook" - sudo: yes - gather_facts: yes - pre_tasks: - - name: "Set default baremetal.csv file if not already defined" - set_fact: - baremetal_csv_file: "/tmp/baremetal.csv" - when: baremetal_csv_file is not defined - - name: "Set OpenStack CI settings if it appears we are running in upstream OpenStack CI" - set_fact: - ci_testing: true - ci_testing_zuul: true - ironic_git_folder: /opt/git/openstack/ironic - ironicclient_git_folder: /opt/git/openstack/python-ironicclient - shade_git_folder: /opt/git/openstack-infra/shade - when: lookup('env', 'ZUUL_BRANCH') != "" - - name: "Set ci_testing_zuul_changes if ZUUL_CHANGES is set" - set_fact: - ci_testing_zuul_changes: true - when: lookup('env', 'ZUUL_CHANGES') != "" - - name: "Collect process list if running in OpenStack CI" - command: ps aux - when: ci_testing_zuul is defined - - name: "Collect list of listening network sockets if running in OpenStack CI" - shell: netstat -apn|grep LISTEN - when: ci_testing_zuul is defined - roles: - - role: bifrost-create-vm-nodes - - { role: bifrost-prep-for-install, when: skip_install is not defined } - - { role: bifrost-openstack-ci-prep, when: ci_testing_zuul is defined } - - role: ironic-install - cleaning: false - testing: true - - { role: bifrost-create-dib-image, when: create_image_via_dib == true and transform_boot_image == false } - - { role: bifrost-create-bootable-image, when: create_image_via_dib == false and transform_boot_image == true } - - role: ironic-enroll - testing: true - - role: bifrost-validate-host-for-deploy - environment: - http_proxy: "{{ lookup('env','http_proxy') }}" - https_proxy: "{{ lookup('env','https_proxy') }}" -- hosts: localhost - connection: local - name: "Executes install, enrollment, and testing in one playbook" - sudo: no - gather_facts: yes - roles: - - role: bifrost-configdrives - - role: bifrost-setup-nodes - - role: bifrost-prepare-for-test -# The testvm Host group is added by bifrost-prepare-for-test based -# on the contents of the CSV file. -- hosts: testvm - name: "Tests connectivity to the VM" - sudo: no - gather_facts: no - remote_user: "{{testing_user}}" - roles: - - role: bifrost-test-vm -- hosts: localhost - connection: local - name: "Unprovisions the test node" - sudo: no - gather_facts: no - roles: - - role: bifrost-unprovision-nodes -- hosts: localhost - connection: local - name: "Unprovisions the test node" - sudo: no - gather_facts: no - roles: - - role: ironic-delete diff --git a/scripts/test-bifrost.sh b/scripts/test-bifrost.sh index 1f59a9c07..dd801a740 100755 --- a/scripts/test-bifrost.sh +++ b/scripts/test-bifrost.sh @@ -19,9 +19,6 @@ set -x # Change working directory cd $BIFROST_HOME/playbooks -# Perform a syntax check -ansible-playbook -vvvv -i inventory/localhost test-bifrost.yaml --syntax-check --list-tasks - # Syntax check of dynamic inventory test path ansible-playbook -vvvv -i inventory/localhost test-bifrost-create-vm.yaml --syntax-check --list-tasks ansible-playbook -vvvv -i inventory/localhost test-bifrost-dynamic.yaml --syntax-check --list-tasks