diff --git a/_DeploymentAndDistroPackaging/ansible/ciao_computes.yml b/_DeploymentAndDistroPackaging/ansible/ciao_computes.yml index 4383aa8a2..240a80f32 100644 --- a/_DeploymentAndDistroPackaging/ansible/ciao_computes.yml +++ b/_DeploymentAndDistroPackaging/ansible/ciao_computes.yml @@ -15,6 +15,8 @@ - hosts: computes become: yes + vars: + ciao_role: compute roles: - docker - - ciao-compute + - ciao-launcher diff --git a/_DeploymentAndDistroPackaging/ansible/ciao_networks.yml b/_DeploymentAndDistroPackaging/ansible/ciao_networks.yml index 844ea2958..c4d16017d 100644 --- a/_DeploymentAndDistroPackaging/ansible/ciao_networks.yml +++ b/_DeploymentAndDistroPackaging/ansible/ciao_networks.yml @@ -15,5 +15,7 @@ - hosts: networks become: yes + vars: + ciao_role: network roles: - - ciao-network + - ciao-launcher diff --git a/_DeploymentAndDistroPackaging/ansible/cleanup/ciao.yml b/_DeploymentAndDistroPackaging/ansible/cleanup/ciao.yml index 75c9377e9..f67c27694 100644 --- a/_DeploymentAndDistroPackaging/ansible/cleanup/ciao.yml +++ b/_DeploymentAndDistroPackaging/ansible/cleanup/ciao.yml @@ -67,6 +67,7 @@ with_items: - ciao-network.service - ciao-compute.service + - ciao-launcher.service - docker.service - docker-cor.service ignore_errors: yes @@ -76,6 +77,7 @@ with_items: - /etc/systemd/system/ciao-network.service - /etc/systemd/system/ciao-compute.service + - /etc/systemd/system/ciao-launcher.service - name: Remove CIAO files file: path={{ item }} state=absent diff --git a/_DeploymentAndDistroPackaging/ansible/roles/ciao-compute/meta/main.yml b/_DeploymentAndDistroPackaging/ansible/roles/ciao-compute/meta/main.yml deleted file mode 100644 index d46c0c701..000000000 --- a/_DeploymentAndDistroPackaging/ansible/roles/ciao-compute/meta/main.yml +++ /dev/null @@ -1,40 +0,0 @@ ---- -# Copyright (c) 2016 Intel Corporation -# -# 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. - -galaxy_info: - author: Alberto Murillo - description: Ansible role to install the compute node for a CIAO cluster - company: Intel - - issue_tracker_url: https://github.com/01org/ciao - - license: Apache - - min_ansible_version: 2.1 - - platforms: - - name: Ubuntu - versions: - - xenial - - name: ClearLinux - - galaxy_tags: - - ubuntu - - xenial - - clearlinux - - ciao - -dependencies: - - ciao-common diff --git a/_DeploymentAndDistroPackaging/ansible/roles/ciao-compute/tasks/install.yml b/_DeploymentAndDistroPackaging/ansible/roles/ciao-compute/tasks/install.yml deleted file mode 100644 index 50d0c057b..000000000 --- a/_DeploymentAndDistroPackaging/ansible/roles/ciao-compute/tasks/install.yml +++ /dev/null @@ -1,29 +0,0 @@ ---- -# Copyright (c) 2016 Intel Corporation -# -# 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: Copy CIAO Binaries - copy: src={{ gopath }}/bin/{{ item }} dest={{ bindir }}/{{ item }} mode=755 - with_items: - - ciao-cert - - ciao-cli - - ciao-launcher - when: ciao_dev - notify: restart compute - - - name: Copy Compute Node Agent Key - copy: src=certificates/ciao/{{ item }} dest=/etc/pki/ciao/{{ item }} - with_items: - - CAcert-{{ ciao_controller_fqdn }}.pem - - cert-CNAgent-localhost.pem diff --git a/_DeploymentAndDistroPackaging/ansible/roles/ciao-compute/tasks/startservices.yml b/_DeploymentAndDistroPackaging/ansible/roles/ciao-compute/tasks/startservices.yml deleted file mode 100644 index 9abee9caa..000000000 --- a/_DeploymentAndDistroPackaging/ansible/roles/ciao-compute/tasks/startservices.yml +++ /dev/null @@ -1,25 +0,0 @@ ---- -# Copyright (c) 2016 Intel Corporation -# -# 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: Create ciao-compute unit - template: src=ciao-compute.service.j2 dest=/etc/systemd/system/ciao-compute.service - notify: - - reload systemd config - - restart compute - - - meta: flush_handlers - - - name: Ensure ciao-compute service is running - service: name=ciao-compute.service enabled=yes state=started diff --git a/_DeploymentAndDistroPackaging/ansible/roles/ciao-compute/README.md b/_DeploymentAndDistroPackaging/ansible/roles/ciao-launcher/README.md similarity index 65% rename from _DeploymentAndDistroPackaging/ansible/roles/ciao-compute/README.md rename to _DeploymentAndDistroPackaging/ansible/roles/ciao-launcher/README.md index c6cb10afa..818b4d75e 100644 --- a/_DeploymentAndDistroPackaging/ansible/roles/ciao-compute/README.md +++ b/_DeploymentAndDistroPackaging/ansible/roles/ciao-launcher/README.md @@ -1,5 +1,5 @@ -# clearlinux.ciao-compute -Ansible role to install the compute node for a CIAO cluster +# clearlinux.ciao-launcher +Ansible role to install the compute or network node for a CIAO cluster ## Requirements * docker @@ -16,8 +16,16 @@ The available variables for this roles are the variables from [ciao-common](../c file *ciao.yml* ``` - hosts: computes + vars: + ciao_role: compute roles: - - clearlinux.ciao-compute + - clearlinux.ciao-launcher + +- hosts: networks + vars: + ciao_role: network + roles: + - clearlinux.ciao-launcher ``` file *group_vars/all* diff --git a/_DeploymentAndDistroPackaging/ansible/roles/ciao-network/handlers/main.yml b/_DeploymentAndDistroPackaging/ansible/roles/ciao-launcher/handlers/main.yml similarity index 86% rename from _DeploymentAndDistroPackaging/ansible/roles/ciao-network/handlers/main.yml rename to _DeploymentAndDistroPackaging/ansible/roles/ciao-launcher/handlers/main.yml index 1defd4dc7..5189c449f 100644 --- a/_DeploymentAndDistroPackaging/ansible/roles/ciao-network/handlers/main.yml +++ b/_DeploymentAndDistroPackaging/ansible/roles/ciao-launcher/handlers/main.yml @@ -13,5 +13,5 @@ # See the License for the specific language governing permissions and # limitations under the License. - - name: restart network - service: name=ciao-network.service enabled=yes state=restarted + - name: restart launcher + service: name=ciao-launcher.service enabled=yes state=restarted diff --git a/_DeploymentAndDistroPackaging/ansible/roles/ciao-network/meta/main.yml b/_DeploymentAndDistroPackaging/ansible/roles/ciao-launcher/meta/main.yml similarity index 91% rename from _DeploymentAndDistroPackaging/ansible/roles/ciao-network/meta/main.yml rename to _DeploymentAndDistroPackaging/ansible/roles/ciao-launcher/meta/main.yml index 1b1a4ecf5..3bc48286b 100644 --- a/_DeploymentAndDistroPackaging/ansible/roles/ciao-network/meta/main.yml +++ b/_DeploymentAndDistroPackaging/ansible/roles/ciao-launcher/meta/main.yml @@ -15,7 +15,7 @@ galaxy_info: author: Alberto Murillo - description: Ansible role to install the network node for a CIAO cluster + description: Ansible role to install the compute or network node for a CIAO cluster company: Intel issue_tracker_url: https://github.com/01org/ciao diff --git a/_DeploymentAndDistroPackaging/ansible/roles/ciao-network/tasks/install.yml b/_DeploymentAndDistroPackaging/ansible/roles/ciao-launcher/tasks/install.yml similarity index 88% rename from _DeploymentAndDistroPackaging/ansible/roles/ciao-network/tasks/install.yml rename to _DeploymentAndDistroPackaging/ansible/roles/ciao-launcher/tasks/install.yml index aaaeeff33..3ddd1f739 100644 --- a/_DeploymentAndDistroPackaging/ansible/roles/ciao-network/tasks/install.yml +++ b/_DeploymentAndDistroPackaging/ansible/roles/ciao-launcher/tasks/install.yml @@ -20,10 +20,11 @@ - ciao-cli - ciao-launcher when: ciao_dev - notify: restart network + notify: restart launcher - - name: Copy Network Node Agent Key + - name: Copy ciao certificates copy: src=certificates/ciao/{{ item }} dest=/etc/pki/ciao/{{ item }} with_items: - CAcert-{{ ciao_controller_fqdn }}.pem - - cert-NetworkingAgent-localhost.pem + - "{{ agent_key }}" + notify: restart launcher diff --git a/_DeploymentAndDistroPackaging/ansible/roles/ciao-compute/tasks/main.yml b/_DeploymentAndDistroPackaging/ansible/roles/ciao-launcher/tasks/main.yml similarity index 94% rename from _DeploymentAndDistroPackaging/ansible/roles/ciao-compute/tasks/main.yml rename to _DeploymentAndDistroPackaging/ansible/roles/ciao-launcher/tasks/main.yml index 5e98b4c0a..199a1add8 100644 --- a/_DeploymentAndDistroPackaging/ansible/roles/ciao-compute/tasks/main.yml +++ b/_DeploymentAndDistroPackaging/ansible/roles/ciao-launcher/tasks/main.yml @@ -13,5 +13,6 @@ # See the License for the specific language governing permissions and # limitations under the License. + - include_vars: "{{ ciao_role }}.yml" - include: install.yml - include: startservices.yml diff --git a/_DeploymentAndDistroPackaging/ansible/roles/ciao-network/tasks/startservices.yml b/_DeploymentAndDistroPackaging/ansible/roles/ciao-launcher/tasks/startservices.yml similarity index 71% rename from _DeploymentAndDistroPackaging/ansible/roles/ciao-network/tasks/startservices.yml rename to _DeploymentAndDistroPackaging/ansible/roles/ciao-launcher/tasks/startservices.yml index 3313deb9e..d9a89fb1e 100644 --- a/_DeploymentAndDistroPackaging/ansible/roles/ciao-network/tasks/startservices.yml +++ b/_DeploymentAndDistroPackaging/ansible/roles/ciao-launcher/tasks/startservices.yml @@ -13,13 +13,13 @@ # See the License for the specific language governing permissions and # limitations under the License. - - name: Create ciao-network unit - template: src=ciao-network.service.j2 dest=/etc/systemd/system/ciao-network.service + - name: Create ciao-launcher unit + template: src=ciao-launcher.service.j2 dest=/etc/systemd/system/ciao-launcher.service notify: - reload systemd config - - restart network + - restart launcher - meta: flush_handlers - - name: Ensure ciao-network service is running - service: name=ciao-network.service enabled=yes state=started + - name: Ensure ciao-launcher service is running + service: name=ciao-launcher.service enabled=yes state=started diff --git a/_DeploymentAndDistroPackaging/ansible/roles/ciao-compute/templates/ciao-compute.service.j2 b/_DeploymentAndDistroPackaging/ansible/roles/ciao-launcher/templates/ciao-launcher.service.j2 similarity index 68% rename from _DeploymentAndDistroPackaging/ansible/roles/ciao-compute/templates/ciao-compute.service.j2 rename to _DeploymentAndDistroPackaging/ansible/roles/ciao-launcher/templates/ciao-launcher.service.j2 index 725736563..3854b8d9c 100644 --- a/_DeploymentAndDistroPackaging/ansible/roles/ciao-compute/templates/ciao-compute.service.j2 +++ b/_DeploymentAndDistroPackaging/ansible/roles/ciao-launcher/templates/ciao-launcher.service.j2 @@ -1,11 +1,11 @@ [Unit] -Description=CIAO Compute Launcher Service +Description=CIAO Launcher Service After=network.target [Service] Type=simple ExecStart={{ bindir }}/ciao-launcher --cacert=/etc/pki/ciao/CAcert-{{ ciao_controller_fqdn }}.pem \ - --cert=/etc/pki/ciao/cert-CNAgent-localhost.pem \ + --cert=/etc/pki/ciao/{{ agent_key }} \ --logtostderr -v 2 Restart=always KillMode=process diff --git a/_DeploymentAndDistroPackaging/ansible/roles/ciao-network/tasks/main.yml b/_DeploymentAndDistroPackaging/ansible/roles/ciao-launcher/vars/compute.yml similarity index 88% rename from _DeploymentAndDistroPackaging/ansible/roles/ciao-network/tasks/main.yml rename to _DeploymentAndDistroPackaging/ansible/roles/ciao-launcher/vars/compute.yml index 5e98b4c0a..0fc0459e0 100644 --- a/_DeploymentAndDistroPackaging/ansible/roles/ciao-network/tasks/main.yml +++ b/_DeploymentAndDistroPackaging/ansible/roles/ciao-launcher/vars/compute.yml @@ -13,5 +13,5 @@ # See the License for the specific language governing permissions and # limitations under the License. - - include: install.yml - - include: startservices.yml +# Name of the compute node agent key +agent_key: cert-CNAgent-localhost.pem diff --git a/_DeploymentAndDistroPackaging/ansible/roles/ciao-compute/handlers/main.yml b/_DeploymentAndDistroPackaging/ansible/roles/ciao-launcher/vars/network.yml similarity index 86% rename from _DeploymentAndDistroPackaging/ansible/roles/ciao-compute/handlers/main.yml rename to _DeploymentAndDistroPackaging/ansible/roles/ciao-launcher/vars/network.yml index 45411b175..caf3de401 100644 --- a/_DeploymentAndDistroPackaging/ansible/roles/ciao-compute/handlers/main.yml +++ b/_DeploymentAndDistroPackaging/ansible/roles/ciao-launcher/vars/network.yml @@ -13,5 +13,5 @@ # See the License for the specific language governing permissions and # limitations under the License. - - name: restart compute - service: name=ciao-compute.service enabled=yes state=restarted +# Name of the network node agent key +agent_key: cert-NetworkingAgent-localhost.pem diff --git a/_DeploymentAndDistroPackaging/ansible/roles/ciao-network/README.md b/_DeploymentAndDistroPackaging/ansible/roles/ciao-network/README.md deleted file mode 100644 index ab1399e92..000000000 --- a/_DeploymentAndDistroPackaging/ansible/roles/ciao-network/README.md +++ /dev/null @@ -1,30 +0,0 @@ -# clearlinux.ciao-network -Ansible role to install the network node for a CIAO cluster - -## Requirements -* qemu-kvm - -## Role Variables -The available variables for this roles are the variables from [ciao-common](../ciao-common) - -## Dependencies -* [ciao-common](../ciao-common) - -## Example Playbook -file *ciao.yml* -``` -- hosts: networks - roles: - - clearlinux.ciao-network -``` - -file *group_vars/all* -``` -ciao_controller_fqdn: controller.example.com -``` - -## License -Apache-2.0 - -## Author Information -This role was created by [Alberto Murillo](alberto.murillo.silva@intel.com) diff --git a/_DeploymentAndDistroPackaging/ansible/roles/ciao-network/templates/ciao-network.service.j2 b/_DeploymentAndDistroPackaging/ansible/roles/ciao-network/templates/ciao-network.service.j2 deleted file mode 100644 index 258e9ffb9..000000000 --- a/_DeploymentAndDistroPackaging/ansible/roles/ciao-network/templates/ciao-network.service.j2 +++ /dev/null @@ -1,14 +0,0 @@ -[Unit] -Description=CIAO Controller Service -After=network.target - -[Service] -Type=simple -ExecStart={{ bindir }}/ciao-launcher --cacert=/etc/pki/ciao/CAcert-{{ ciao_controller_fqdn }}.pem \ - --cert=/etc/pki/ciao/cert-NetworkingAgent-localhost.pem \ - --logtostderr -v 2 -Restart=always -KillMode=process - -[Install] -WantedBy=multi-user.target