diff --git a/README.rst b/README.rst index 68dd7cc90..0faa5b4c0 100644 --- a/README.rst +++ b/README.rst @@ -35,7 +35,6 @@ Edit ./inventory/group_vars/all.yaml to match your environment. Then run:: - cd install bash ./env-setup.sh source /opt/stack/ansible/hacking/env-setup cd .. @@ -62,7 +61,7 @@ restarted. Run:: - ansible-playbook -vvvv -i inventory/localhost install/install.yaml + ansible-playbook -vvvv -i inventory/localhost install.yaml Manual CLI Use @@ -74,7 +73,7 @@ environment variables: - IRONIC_URL - A URL to the Ironic API, such as http://localhost:6385/ - OS_AUTH_TOKEN - Any value, such as an empty space, is required to cause the client library to send requests directly to the API. -For your ease of use, install/env-vars can be sourced to allow the CLI to connect +For your ease of use, `env-vars` can be sourced to allow the CLI to connect to a local Ironic installation operating in noauth mode. @@ -129,7 +128,7 @@ consumed and loaded into ironic. Example:: - ansible-playbook -i inventory/localhost -vvvv enroll/enroll.yaml -e baremetal_csv_file=inventory/baremetal.csv + 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 @@ -154,4 +153,4 @@ drive and are statically assigned. Example:: - ansible-playbook -i inventory/localhost -vvvv deploy/deploy.yaml -e baremetal_csv_file=inventory/baremetal.csv + ansible-playbook -i inventory/localhost -vvvv deploy.yaml -e baremetal_csv_file=inventory/baremetal.csv diff --git a/deploy.yaml b/deploy.yaml new file mode 100644 index 000000000..36af6f8c4 --- /dev/null +++ b/deploy.yaml @@ -0,0 +1,15 @@ +--- +- hosts: localhost + connection: local + name: "Enroll hardware from baremetal.csv into Ironic" + sudo: yes + gather_facts: yes + 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: ironic-deploy + baremetal_csv_file: "{{ baremetal_csv_file }}" + - role: bifrost-configdrives + - role: bifrost-setup-nodes diff --git a/deploy/deploy.yaml b/deploy/deploy.yaml deleted file mode 100644 index 9ab969e39..000000000 --- a/deploy/deploy.yaml +++ /dev/null @@ -1,48 +0,0 @@ ---- -- hosts: localhost - connection: local - name: "Enroll hardware from baremetal.csv into Ironic" - sudo: yes - gather_facts: yes - # Todo: Rip vars out, refactor. - 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 - - name: "Validate that CSV file exists" - local_action: stat path={{ baremetal_csv_file }} - register: test_baremetal_csv_file - - name: "Error if file does not exist." - local_action: 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: "Verify CoreOS kernel is present." - local_action: stat path={{ http_boot_folder }}/coreos_production_pxe.vmlinuz - register: test_core_os_kernel_present - - name: "Error if the CoreOS kernel is missing." - local_action: fail msg="CoreOS kernel not found. Consider re-running setup." - when: test_core_os_kernel_present.stat.exists == false - - name: "Verify CoreOS ramdisk is present." - local_action: stat path={{ http_boot_folder }}/coreos_production_pxe_image-oem.cpio.gz - register: test_core_os_image_present - - name: "Error if the CoreOS ramdisk is missing." - local_action: fail msg="CoreOS ramdisk was not found. Consider re-running setup." - when: test_core_os_image_present.stat.exists == false - - name: "Verify that deployment image is present." - local_action: stat path={{deploy_image}} - register: test_deploy_image - # TODO: checksum for the above stat operation will be required for deployment. - - name: "Error if deployment image is missing." - local_action: fail msg="Deployment image is missing. Consider re-running setup." - when: test_deploy_image.stat.exists == false - - name: "Check to see if there is a file where the ssh_key_path is defined" - local_action: stat path={{ ssh_public_key_path }} - register: test_ssh_public_key_path - - name: "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: "Read ssh public key in" - local_action: set_fact ssh_public_key="{{ lookup('file', ssh_public_key_path ) }}" - - name: "Create configdrives" - include: configdrive.yaml - - name: "Enroll nodes in Ironic" - include: setup_nodes.yaml diff --git a/enroll.yaml b/enroll.yaml new file mode 100644 index 000000000..d40d9f54d --- /dev/null +++ b/enroll.yaml @@ -0,0 +1,10 @@ +--- +- 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 }}" + ipmi_bridging: "{{ ipmi_bridging|default('no') }}" diff --git a/enroll/enroll.yaml b/enroll/enroll.yaml deleted file mode 100644 index 97a7c24b9..000000000 --- a/enroll/enroll.yaml +++ /dev/null @@ -1,29 +0,0 @@ ---- -- hosts: localhost - connection: local - name: "Enroll hardware from baremetal.csv into Ironic" - sudo: yes - gather_facts: yes - # Todo: Rip vars out, refactor. - 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 - - name: "Validate that CSV file exists" - local_action: stat path={{ baremetal_csv_file }} - register: test_baremetal_csv_file - - name: "Error if file does not exist." - local_action: 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: testing == false and (ipmi_bridging is not defined or ipmi_bridging == "no") - - name: "If ipmi_bridging is set to single, execute single bridge enrollment sequence.." - include: ipmi_bridging_single_enroll.yaml - when: testing == false 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 == false and (ipmi_bridging is defined and ipmi_bridging == "dual") diff --git a/install/env-setup.sh b/env-setup.sh similarity index 100% rename from install/env-setup.sh rename to env-setup.sh diff --git a/install/env-vars b/env-vars similarity index 100% rename from install/env-vars rename to env-vars diff --git a/install/install.yaml b/install.yaml similarity index 75% rename from install/install.yaml rename to install.yaml index 78578d40f..0d9bddcbd 100644 --- a/install/install.yaml +++ b/install.yaml @@ -5,4 +5,4 @@ sudo: yes gather_facts: yes roles: - - install_standalone_ironic_localhost + - install-ironic diff --git a/roles/bifrost-configdrives/README.md b/roles/bifrost-configdrives/README.md new file mode 100644 index 000000000..225dd44b9 --- /dev/null +++ b/roles/bifrost-configdrives/README.md @@ -0,0 +1,38 @@ +Role Name +========= + +A brief description of the role goes here. + +Requirements +------------ + +Any pre-requisites that may not be covered by Ansible itself or the role should be mentioned here. For instance, if the role uses the EC2 module, it may be a good idea to mention in this section that the boto package is required. + +Role Variables +-------------- + +A description of the settable variables for this role should go here, including any variables that are in defaults/main.yml, vars/main.yml, and any variables that can/should be set via parameters to the role. Any variables that are read from other roles and/or the global scope (ie. hostvars, group vars, etc.) should be mentioned here as well. + +Dependencies +------------ + +A list of other roles hosted on Galaxy should go here, plus any details in regards to parameters that may need to be set for other roles, or variables that are used from other roles. + +Example Playbook +---------------- + +Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too: + + - hosts: servers + roles: + - { role: username.rolename, x: 42 } + +License +------- + +BSD + +Author Information +------------------ + +An optional section for the role authors to include contact information, or a website (HTML is not allowed). diff --git a/roles/bifrost-configdrives/defaults/main.yml b/roles/bifrost-configdrives/defaults/main.yml new file mode 100644 index 000000000..66b494de4 --- /dev/null +++ b/roles/bifrost-configdrives/defaults/main.yml @@ -0,0 +1,2 @@ +--- +# defaults file for bifrost-configdrives diff --git a/roles/bifrost-configdrives/handlers/main.yml b/roles/bifrost-configdrives/handlers/main.yml new file mode 100644 index 000000000..4ed0a58e2 --- /dev/null +++ b/roles/bifrost-configdrives/handlers/main.yml @@ -0,0 +1,2 @@ +--- +# handlers file for bifrost-configdrives diff --git a/roles/bifrost-configdrives/meta/main.yml b/roles/bifrost-configdrives/meta/main.yml new file mode 100644 index 000000000..12a56b50c --- /dev/null +++ b/roles/bifrost-configdrives/meta/main.yml @@ -0,0 +1,116 @@ +--- +galaxy_info: + author: Ironic Developers + description: + 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/deploy/configdrive.yaml b/roles/bifrost-configdrives/tasks/main.yml similarity index 100% rename from deploy/configdrive.yaml rename to roles/bifrost-configdrives/tasks/main.yml diff --git a/roles/bifrost-configdrives/vars/main.yml b/roles/bifrost-configdrives/vars/main.yml new file mode 100644 index 000000000..13580d052 --- /dev/null +++ b/roles/bifrost-configdrives/vars/main.yml @@ -0,0 +1,2 @@ +--- +# vars file for bifrost-configdrives diff --git a/roles/bifrost-setup-nodes/README.md b/roles/bifrost-setup-nodes/README.md new file mode 100644 index 000000000..225dd44b9 --- /dev/null +++ b/roles/bifrost-setup-nodes/README.md @@ -0,0 +1,38 @@ +Role Name +========= + +A brief description of the role goes here. + +Requirements +------------ + +Any pre-requisites that may not be covered by Ansible itself or the role should be mentioned here. For instance, if the role uses the EC2 module, it may be a good idea to mention in this section that the boto package is required. + +Role Variables +-------------- + +A description of the settable variables for this role should go here, including any variables that are in defaults/main.yml, vars/main.yml, and any variables that can/should be set via parameters to the role. Any variables that are read from other roles and/or the global scope (ie. hostvars, group vars, etc.) should be mentioned here as well. + +Dependencies +------------ + +A list of other roles hosted on Galaxy should go here, plus any details in regards to parameters that may need to be set for other roles, or variables that are used from other roles. + +Example Playbook +---------------- + +Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too: + + - hosts: servers + roles: + - { role: username.rolename, x: 42 } + +License +------- + +BSD + +Author Information +------------------ + +An optional section for the role authors to include contact information, or a website (HTML is not allowed). diff --git a/roles/bifrost-setup-nodes/defaults/main.yml b/roles/bifrost-setup-nodes/defaults/main.yml new file mode 100644 index 000000000..8856aab35 --- /dev/null +++ b/roles/bifrost-setup-nodes/defaults/main.yml @@ -0,0 +1,2 @@ +--- +# defaults file for bifrost-setup-nodes diff --git a/roles/bifrost-setup-nodes/handlers/main.yml b/roles/bifrost-setup-nodes/handlers/main.yml new file mode 100644 index 000000000..dc8166578 --- /dev/null +++ b/roles/bifrost-setup-nodes/handlers/main.yml @@ -0,0 +1,2 @@ +--- +# handlers file for bifrost-setup-nodes diff --git a/roles/bifrost-setup-nodes/meta/main.yml b/roles/bifrost-setup-nodes/meta/main.yml new file mode 100644 index 000000000..12a56b50c --- /dev/null +++ b/roles/bifrost-setup-nodes/meta/main.yml @@ -0,0 +1,116 @@ +--- +galaxy_info: + author: Ironic Developers + description: + 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/deploy/setup_nodes.yaml b/roles/bifrost-setup-nodes/tasks/main.yml similarity index 100% rename from deploy/setup_nodes.yaml rename to roles/bifrost-setup-nodes/tasks/main.yml diff --git a/roles/bifrost-setup-nodes/vars/main.yml b/roles/bifrost-setup-nodes/vars/main.yml new file mode 100644 index 000000000..a4473eb78 --- /dev/null +++ b/roles/bifrost-setup-nodes/vars/main.yml @@ -0,0 +1,2 @@ +--- +# vars file for bifrost-setup-nodes diff --git a/roles/ironic-deploy/README.md b/roles/ironic-deploy/README.md new file mode 100644 index 000000000..225dd44b9 --- /dev/null +++ b/roles/ironic-deploy/README.md @@ -0,0 +1,38 @@ +Role Name +========= + +A brief description of the role goes here. + +Requirements +------------ + +Any pre-requisites that may not be covered by Ansible itself or the role should be mentioned here. For instance, if the role uses the EC2 module, it may be a good idea to mention in this section that the boto package is required. + +Role Variables +-------------- + +A description of the settable variables for this role should go here, including any variables that are in defaults/main.yml, vars/main.yml, and any variables that can/should be set via parameters to the role. Any variables that are read from other roles and/or the global scope (ie. hostvars, group vars, etc.) should be mentioned here as well. + +Dependencies +------------ + +A list of other roles hosted on Galaxy should go here, plus any details in regards to parameters that may need to be set for other roles, or variables that are used from other roles. + +Example Playbook +---------------- + +Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too: + + - hosts: servers + roles: + - { role: username.rolename, x: 42 } + +License +------- + +BSD + +Author Information +------------------ + +An optional section for the role authors to include contact information, or a website (HTML is not allowed). diff --git a/roles/ironic-deploy/defaults/main.yml b/roles/ironic-deploy/defaults/main.yml new file mode 100644 index 000000000..60d7bb7a8 --- /dev/null +++ b/roles/ironic-deploy/defaults/main.yml @@ -0,0 +1,2 @@ +--- +# defaults file for ironic-deploy diff --git a/roles/ironic-deploy/handlers/main.yml b/roles/ironic-deploy/handlers/main.yml new file mode 100644 index 000000000..13dd10b42 --- /dev/null +++ b/roles/ironic-deploy/handlers/main.yml @@ -0,0 +1,2 @@ +--- +# handlers file for ironic-deploy diff --git a/roles/ironic-deploy/meta/main.yml b/roles/ironic-deploy/meta/main.yml new file mode 100644 index 000000000..f439e9d31 --- /dev/null +++ b/roles/ironic-deploy/meta/main.yml @@ -0,0 +1,118 @@ +--- +galaxy_info: + author: Ironic Developers + description: + 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: + - bifrost-configdrives + - bifrost-setup-nodes diff --git a/roles/ironic-deploy/tasks/main.yml b/roles/ironic-deploy/tasks/main.yml new file mode 100644 index 000000000..a893e3eb6 --- /dev/null +++ b/roles/ironic-deploy/tasks/main.yml @@ -0,0 +1,37 @@ +--- +- 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 +- name: "Validate that CSV file exists" + local_action: stat path={{ baremetal_csv_file }} + register: test_baremetal_csv_file +- name: "Error if file does not exist." + local_action: 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: "Verify CoreOS kernel is present." + local_action: stat path={{ http_boot_folder }}/coreos_production_pxe.vmlinuz + register: test_core_os_kernel_present +- name: "Error if the CoreOS kernel is missing." + local_action: fail msg="CoreOS kernel not found. Consider re-running setup." + when: test_core_os_kernel_present.stat.exists == false +- name: "Verify CoreOS ramdisk is present." + local_action: stat path={{ http_boot_folder }}/coreos_production_pxe_image-oem.cpio.gz + register: test_core_os_image_present +- name: "Error if the CoreOS ramdisk is missing." + local_action: fail msg="CoreOS ramdisk was not found. Consider re-running setup." + when: test_core_os_image_present.stat.exists == false +- name: "Verify that deployment image is present." + local_action: stat path={{deploy_image}} + register: test_deploy_image + # TODO: checksum for the above stat operation will be required for deployment. +- name: "Error if deployment image is missing." + local_action: fail msg="Deployment image is missing. Consider re-running setup." + when: test_deploy_image.stat.exists == false +- name: "Check to see if there is a file where the ssh_key_path is defined" + local_action: stat path={{ ssh_public_key_path }} + register: test_ssh_public_key_path +- name: "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: "Read ssh public key in" + local_action: set_fact ssh_public_key="{{ lookup('file', ssh_public_key_path ) }}" diff --git a/deploy/templates/interfaces.j2 b/roles/ironic-deploy/templates/interfaces.j2 similarity index 100% rename from deploy/templates/interfaces.j2 rename to roles/ironic-deploy/templates/interfaces.j2 diff --git a/deploy/templates/openstack_meta_data.json.j2 b/roles/ironic-deploy/templates/openstack_meta_data.json.j2 similarity index 100% rename from deploy/templates/openstack_meta_data.json.j2 rename to roles/ironic-deploy/templates/openstack_meta_data.json.j2 diff --git a/roles/ironic-deploy/vars/main.yml b/roles/ironic-deploy/vars/main.yml new file mode 100644 index 000000000..7cbd2992d --- /dev/null +++ b/roles/ironic-deploy/vars/main.yml @@ -0,0 +1,2 @@ +--- +# vars file for ironic-deploy diff --git a/roles/ironic-enroll/README.md b/roles/ironic-enroll/README.md new file mode 100644 index 000000000..225dd44b9 --- /dev/null +++ b/roles/ironic-enroll/README.md @@ -0,0 +1,38 @@ +Role Name +========= + +A brief description of the role goes here. + +Requirements +------------ + +Any pre-requisites that may not be covered by Ansible itself or the role should be mentioned here. For instance, if the role uses the EC2 module, it may be a good idea to mention in this section that the boto package is required. + +Role Variables +-------------- + +A description of the settable variables for this role should go here, including any variables that are in defaults/main.yml, vars/main.yml, and any variables that can/should be set via parameters to the role. Any variables that are read from other roles and/or the global scope (ie. hostvars, group vars, etc.) should be mentioned here as well. + +Dependencies +------------ + +A list of other roles hosted on Galaxy should go here, plus any details in regards to parameters that may need to be set for other roles, or variables that are used from other roles. + +Example Playbook +---------------- + +Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too: + + - hosts: servers + roles: + - { role: username.rolename, x: 42 } + +License +------- + +BSD + +Author Information +------------------ + +An optional section for the role authors to include contact information, or a website (HTML is not allowed). diff --git a/roles/ironic-enroll/defaults/main.yml b/roles/ironic-enroll/defaults/main.yml new file mode 100644 index 000000000..18bbc2f19 --- /dev/null +++ b/roles/ironic-enroll/defaults/main.yml @@ -0,0 +1,2 @@ +--- +# defaults file for ironic-enroll diff --git a/roles/ironic-enroll/handlers/main.yml b/roles/ironic-enroll/handlers/main.yml new file mode 100644 index 000000000..c076eabf4 --- /dev/null +++ b/roles/ironic-enroll/handlers/main.yml @@ -0,0 +1,2 @@ +--- +# handlers file for ironic-enroll diff --git a/roles/ironic-enroll/meta/main.yml b/roles/ironic-enroll/meta/main.yml new file mode 100644 index 000000000..12a56b50c --- /dev/null +++ b/roles/ironic-enroll/meta/main.yml @@ -0,0 +1,116 @@ +--- +galaxy_info: + author: Ironic Developers + description: + 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/enroll/ipmi_bridging_dual_enroll.yaml b/roles/ironic-enroll/tasks/ipmi_bridging_dual_enroll.yaml similarity index 100% rename from enroll/ipmi_bridging_dual_enroll.yaml rename to roles/ironic-enroll/tasks/ipmi_bridging_dual_enroll.yaml diff --git a/enroll/ipmi_bridging_single_enroll.yaml b/roles/ironic-enroll/tasks/ipmi_bridging_single_enroll.yaml similarity index 100% rename from enroll/ipmi_bridging_single_enroll.yaml rename to roles/ironic-enroll/tasks/ipmi_bridging_single_enroll.yaml diff --git a/roles/ironic-enroll/tasks/main.yml b/roles/ironic-enroll/tasks/main.yml new file mode 100644 index 000000000..0789eb076 --- /dev/null +++ b/roles/ironic-enroll/tasks/main.yml @@ -0,0 +1,22 @@ +--- +- 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: testing == false and (ipmi_bridging is not defined or ipmi_bridging == "no") +- name: "If ipmi_bridging is set to single, execute single bridge enrollment sequence.." + include: ipmi_bridging_single_enroll.yaml + when: testing == false 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 == false and (ipmi_bridging is defined and ipmi_bridging == "dual") diff --git a/enroll/standard_enroll.yaml b/roles/ironic-enroll/tasks/standard_enroll.yaml similarity index 100% rename from enroll/standard_enroll.yaml rename to roles/ironic-enroll/tasks/standard_enroll.yaml diff --git a/enroll/virtual_enroll.yaml b/roles/ironic-enroll/tasks/virtual_enroll.yaml similarity index 100% rename from enroll/virtual_enroll.yaml rename to roles/ironic-enroll/tasks/virtual_enroll.yaml diff --git a/roles/ironic-enroll/vars/main.yml b/roles/ironic-enroll/vars/main.yml new file mode 100644 index 000000000..3d7bdbcb3 --- /dev/null +++ b/roles/ironic-enroll/vars/main.yml @@ -0,0 +1,3 @@ +--- +# vars file for ironic-enroll +ipmi_bridging: no diff --git a/install/roles/install_standalone_ironic_localhost/files/boot.ipxe b/roles/ironic-install/files/boot.ipxe similarity index 100% rename from install/roles/install_standalone_ironic_localhost/files/boot.ipxe rename to roles/ironic-install/files/boot.ipxe diff --git a/install/roles/install_standalone_ironic_localhost/files/tftpboot-map-file b/roles/ironic-install/files/tftpboot-map-file similarity index 100% rename from install/roles/install_standalone_ironic_localhost/files/tftpboot-map-file rename to roles/ironic-install/files/tftpboot-map-file diff --git a/install/roles/install_standalone_ironic_localhost/files/xinetd.tftp b/roles/ironic-install/files/xinetd.tftp similarity index 100% rename from install/roles/install_standalone_ironic_localhost/files/xinetd.tftp rename to roles/ironic-install/files/xinetd.tftp diff --git a/roles/ironic-install/meta/main.yml b/roles/ironic-install/meta/main.yml new file mode 100644 index 000000000..12a56b50c --- /dev/null +++ b/roles/ironic-install/meta/main.yml @@ -0,0 +1,116 @@ +--- +galaxy_info: + author: Ironic Developers + description: + 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/install/roles/install_standalone_ironic_localhost/tasks/create_bootable_image.yml b/roles/ironic-install/tasks/create_bootable_image.yml similarity index 100% rename from install/roles/install_standalone_ironic_localhost/tasks/create_bootable_image.yml rename to roles/ironic-install/tasks/create_bootable_image.yml diff --git a/install/roles/install_standalone_ironic_localhost/tasks/create_dib_image.yml b/roles/ironic-install/tasks/create_dib_image.yml similarity index 100% rename from install/roles/install_standalone_ironic_localhost/tasks/create_dib_image.yml rename to roles/ironic-install/tasks/create_dib_image.yml diff --git a/install/roles/install_standalone_ironic_localhost/tasks/dib_install.yml b/roles/ironic-install/tasks/dib_install.yml similarity index 100% rename from install/roles/install_standalone_ironic_localhost/tasks/dib_install.yml rename to roles/ironic-install/tasks/dib_install.yml diff --git a/install/roles/install_standalone_ironic_localhost/tasks/main.yml b/roles/ironic-install/tasks/main.yml similarity index 100% rename from install/roles/install_standalone_ironic_localhost/tasks/main.yml rename to roles/ironic-install/tasks/main.yml diff --git a/install/roles/install_standalone_ironic_localhost/templates/agent_config.template.j2 b/roles/ironic-install/templates/agent_config.template.j2 similarity index 100% rename from install/roles/install_standalone_ironic_localhost/templates/agent_config.template.j2 rename to roles/ironic-install/templates/agent_config.template.j2 diff --git a/install/roles/install_standalone_ironic_localhost/templates/dnsmasq.conf.j2 b/roles/ironic-install/templates/dnsmasq.conf.j2 similarity index 100% rename from install/roles/install_standalone_ironic_localhost/templates/dnsmasq.conf.j2 rename to roles/ironic-install/templates/dnsmasq.conf.j2 diff --git a/install/roles/install_standalone_ironic_localhost/templates/init_template.j2 b/roles/ironic-install/templates/init_template.j2 similarity index 100% rename from install/roles/install_standalone_ironic_localhost/templates/init_template.j2 rename to roles/ironic-install/templates/init_template.j2 diff --git a/install/roles/install_standalone_ironic_localhost/templates/ironic.conf.j2 b/roles/ironic-install/templates/ironic.conf.j2 similarity index 100% rename from install/roles/install_standalone_ironic_localhost/templates/ironic.conf.j2 rename to roles/ironic-install/templates/ironic.conf.j2 diff --git a/install/roles/install_standalone_ironic_localhost/templates/nginx.conf.j2 b/roles/ironic-install/templates/nginx.conf.j2 similarity index 100% rename from install/roles/install_standalone_ironic_localhost/templates/nginx.conf.j2 rename to roles/ironic-install/templates/nginx.conf.j2 diff --git a/install/roles/install_standalone_ironic_localhost/vars/main.yml b/roles/ironic-install/vars/main.yml similarity index 100% rename from install/roles/install_standalone_ironic_localhost/vars/main.yml rename to roles/ironic-install/vars/main.yml