Commit Graph

124 Commits

Author SHA1 Message Date
Alberto Murillo Silva 32bba4a467 ciao-webui: Change syntax to improve readability
Change syntax from:

    'local_action: module args'

    to

    connection: local
    module:
      args

Signed-off-by: Alberto Murillo Silva <alberto.murillo.silva@intel.com>
2016-10-20 15:03:03 -05:00
Alberto Murillo Silva fab229c464 ciao-controller: Fix cnci image creation logic
Delete any of cnci_image.img.xz, cnci_image.img or .cnci_ready files
to let ansible rebuild the cnci image.

If the tree files mentioned above already exists. Skip the
image creation phase.

Signed-off-by: Alberto Murillo Silva <alberto.murillo.silva@intel.com>
2016-10-20 14:52:37 -05:00
Alberto Murillo Silva deda6a8ae5 keystone: Change syntax to improve readability
Change syntax from:

'local_action: module args'

to

connection: local
module:
  args

Signed-off-by: Alberto Murillo Silva <alberto.murillo.silva@intel.com>
2016-10-20 14:20:30 -05:00
Alberto Murillo Silva 420f3de775 ciao-controller: Fix become statements
Roles are invoked with become: yes in the playbook.

This change let all tasks run as root and adds
become: no only to the tasks that need to be run
as the local user.

Fixes #97

Signed-off-by: Alberto Murillo Silva <alberto.murillo.silva@intel.com>
2016-10-20 14:09:27 -05:00
Alberto Murillo Silva 7614e865c5 ciao-controller: Refactor images.yml
Group multiple get_url tasks into one with_items

Signed-off-by: Alberto Murillo Silva <alberto.murillo.silva@intel.com>
2016-10-20 14:07:54 -05:00
Alberto Murillo Silva 94723efd6e ciao-controller: Refactor certificates.yml
Group ubuntu tasks and fedora tasks inside a block

Signed-off-by: Alberto Murillo Silva <alberto.murillo.silva@intel.com>
2016-10-20 14:05:59 -05:00
Alberto Murillo Silva b1a0be33c4 ciao-controller: Update task syntax
- Define tasks attributes in the following order:

- name:
  become:
  connection:
  module:

Signed-off-by: Alberto Murillo Silva <alberto.murillo.silva@intel.com>
2016-10-20 14:03:18 -05:00
Alberto Murillo aa6fef1c83 ciao-webui: Restart ciao-webui container after reboot
Add a docker-ciao-webui.service systemd unit file to ensure
ciao-webui container starts after the host server is rebooted.

Signed-off-by: Alberto Murillo <alberto.murillo.silva@intel.com>
2016-10-18 12:45:11 -05:00
Alberto Murillo 93100af561 keystone: Restart keystone container after reboot
Add a docker-keystone.service systemd unit file to ensure
keystone containers starts after the host server is rebooted.

Fixes #85

Signed-off-by: Alberto Murillo <alberto.murillo.silva@intel.com>
2016-10-18 12:40:02 -05:00
Alberto Murillo 395f39d441 docker: Add docker_service variable
ClearLinux uses docker-cor.service file by default when running
in baremetal (ClearContainers).

docker_service defaults to docker.service for fedora, ubuntu and
clearlinux with no /dev/kvm support.

Signed-off-by: Alberto Murillo <alberto.murillo.silva@intel.com>
2016-10-18 12:35:26 -05:00
Rob Bradford 6aced4034c ciao-compute/ciao-network: Ensure qemu processes stay alive (#84)
When restarting ciao-launcher on the CN or NN it's important to keep the
qemu processes that they've started alive.

The default, KillMode=control-group, will result in all processes in
the control group being killed when the service is stopped. This will
include all the qemu processes created by ciao-launcher as they are
placed into the same cgroup by systemd.

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
2016-10-14 17:32:49 -05:00
Alberto Murillo 6ad6d3615f ciao: Install ciao-cert on all nodes (#90)
ciao-cert now has a -dump parameter which gives information about
the certificates.

This change installs ciao-cert on all nodes with SSNTP certificates
as it is usefull to debug certificate issues.

Fixes #87

Signed-off-by: Alberto Murillo <alberto.murillo.silva@intel.com>
2016-10-14 17:05:48 -05:00
Erick CARDONA dc69f6be64 ciao-compute: Download OVMF.fd when RedHat-based distros (#79)
When using RedHat based compute nodes, it skips the copy of the file.
This commit adds a rule to handle the download when this scenario occurs.

Fixes https://github.com/clearlinux/clear-config-management/issues/77

Signed-off-by: Erick Cardona <erick.cardona.ruiz@intel.com>
2016-10-11 13:00:11 -05:00
Alberto Murillo a53d5c56bc ciao-controller: Do not create /etc/ssl/certs
ClearLinux 10910 creates /etc/ssl/certs as a symlink
to /var/cache/ca-certs and Ubuntu already ships the
directory.

Signed-off-by: Alberto Murillo <alberto.murillo.silva@intel.com>
2016-10-11 12:58:22 -05:00
Alberto Murillo f9d3123ce1 ciao-controller: Run losetup as root
Signed-off-by: Alberto Murillo <alberto.murillo.silva@intel.com>
2016-10-11 11:31:14 -05:00
Marcos Simental 55820f8541 ciao-controller: fix syntax typo while creating cnci image (#80)
Signed-off-by: Simental Magana, Marcos <marcos.simental.magana@intel.com>
2016-10-07 15:47:51 -05:00
Alberto Murillo e5fc7176c9 Docker: Start docker service in clearlinux (#78)
* docker: docker service is not started in clearlinux

Docker service is usually started when docker is installed.

In ClearLinux, docker is not started when containers-basic
bundle is installed

This change enables and starts the docker service to ensure
it is usable after installation.

Fixes #75

Signed-off-by: Alberto Murillo <alberto.murillo.silva@intel.com>

* docker: Add name of distro to distro specific tasks

Signed-off-by: Alberto Murillo <alberto.murillo.silva@intel.com>
2016-10-07 13:39:10 -05:00
Marcos Simental c9dba10716 ciao-controller: remove nbd usage, using loops instead. (#76)
the `qemu-nbd` tool it's used to manipulate the cnci image, which
is already a raw image (not qcow as thought), so we can use
raw image manipulation, removing all the need of nbd manipulation
tools.

Signed-off-by: Simental Magana, Marcos <marcos.simental.magana@intel.com>
2016-10-07 10:17:53 -05:00
Marcos Simental 8c28d57cdc ciao-common: update cloud-image link for clearlinux (#71)
Provide a static link for the cloud image.

Signed-off-by: Simental Magana, Marcos <marcos.simental.magana@intel.com>
2016-10-05 16:58:24 -05:00
Marcos Simental a6cd7f5315 ciao-controller: explicitly specify local tasks for build. (#70)
Before this commit, all build tasks for the ciao-controller
role were perfomed as `connection: local`, this is handy
but not accurate (e.g: "Fetch ciao files" shouldn't be local).

This commit specifies which tasks in build should be
performed as local, instead of the whole build.yml playbook.

Signed-off-by: Simental Magana, Marcos <marcos.simental.magana@intel.com>
2016-10-05 14:47:10 -05:00
Alberto Murillo 48eabe3b52 ciao: Change default value for gopath (#68)
Using $GOPATH as the value for gopath is not
so easily achievable because the GOPATH value
for the deployment machine does not get copied
automatically to other nodes.

Also setting a fact on one node does not set it
on other nodes.

The easiest way to share this value across the
different ciao roles is to set it as a variable
that can be overriden in groups_vars/all file or
via the cmdline with --extra-vars "gopath=$GOPATH"

Fixes: #57

Signed-off-by: Alberto Murillo <alberto.murillo.silva@intel.com>
2016-10-03 17:57:30 -05:00
Alberto Murillo fe5aba7d4f ciao-controller: remove secret_path option from configuration
This option is no longer configurable since there is no secure
way to pass this value to qemu cli other than looking for the
default path for the keyring file.

Signed-off-by: Alberto Murillo <alberto.murillo.silva@intel.com>
2016-10-03 13:36:34 -05:00
Alberto Murillo e92592adce ciao: create admin-openrc and demo-openrc (#60)
The playbooks were creating a ciaorc to authenticate the cli
with the ciao user.

The ciao user is reserved for ciao services authenticating into keystone
and should not be used in the cli to create instances.

This changes creates admin-openrc with credentials for the admin user
and demo-openrc with credentials for the demo user to be used by ciao-cli.

Fixes #46

Signed-off-by: Alberto Murillo <alberto.murillo.silva@intel.com>
2016-09-27 11:19:51 -05:00
Alberto Murillo ed877efe97 ciao-common: Create /etc/systemd/system (#61)
ciao creates systemd unit files to start ciao services.

In the case of ClearLinux, there is the possibility that
/etc/systemd/system has not been created yet. This change
ensures /etc/systemd/system is present before trying to
create unit files there.

Fixes #53

Signed-off-by: Alberto Murillo <alberto.murillo.silva@intel.com>
2016-09-27 10:53:48 -05:00
Alberto Murillo 89dd487af9 ciao-common: Add gopath variable
- Allow the user to customize the location of GOPATH
- Remove -u option from go get command to pickup changes
  made by developers that are not ready in the repository.

Fixes #40

Signed-off-by: Alberto Murillo <alberto.murillo.silva@intel.com>
2016-09-19 14:37:25 -05:00
Alberto Murillo 601dfe89a8 documentation: Add contribution notice
Add a contribution notice on each role to direct users to
open issues and pull requests at github.com/clearlinux/clear-config-management
rather than github.com/clearlinux/ansible-role-<rolename>

Fixes #43

Signed-off-by: Alberto Murillo <alberto.murillo.silva@intel.com>
2016-09-19 11:54:01 -05:00
Alberto Murillo 93cf10a1bb ciao-controller: Do not validate certs when downloading images
SOmetimes when behind a proxy, cnci and fedora images cannot be
downloaded because of certificate cannot be validated.

Fixes #45

Signed-off-by: Alberto Murillo <alberto.murillo.silva@intel.com>
2016-09-09 14:04:38 -05:00
Alberto Murillo c65d594bad Restart services when binaries gets updated.
When ciao_dev is set to true and there was an update in the code, ciao
sources is updated and binaries are recompiled and transfered to the nodes
but the service were not being restarted.

Fixes #42

Signed-off-by: Alberto Murillo <alberto.murillo.silva@intel.com>
2016-09-09 11:13:27 -05:00
Alberto Murillo ae2051a282 ciao-controller: Add ceph configuration
add ceph_id and secret_path variables to specify the
cephx user id and its keyring file in the configuration file.

Signed-off-by: Alberto Murillo <alberto.murillo.silva@intel.com>
2016-09-09 10:53:28 -05:00
Alberto Murillo 4b0633187c ciao-controller: Create storage service and endpoint in keystone
Signed-off-by: Alberto Murillo <alberto.murillo.silva@intel.com>
2016-09-07 15:48:30 -05:00
Alberto Murillo 988fae36aa keystone: Fix become issues
- Creation of openrc and clouds.yaml file should be done
in the current directory of the user running the playbook.

Signed-off-by: Alberto Murillo <alberto.murillo.silva@intel.com>
2016-09-07 12:14:51 -05:00
Alberto Murillo f870a3ef20 Update ciao deployment
- Deployment of ciao has changed from installing everyghin in packages
to install keystone and ciao-webui from containers.

- ciao-laucher will detect the operating system and install the required
dependencies

- Support for Ubuntu 16.04 and Fedora 24 has been added.

Signed-off-by: Alberto Murillo <alberto.murillo.silva@intel.com>
2016-09-02 11:17:47 -05:00
Alberto Murillo 41bf025adc keystone: Run a keystone container
This role will start a docker container with keystone
already configured with SSL based on the dockerhub image
clearlinux/keystone

Signed-off-by: Alberto Murillo <alberto.murillo.silva@intel.com>
2016-09-02 11:17:47 -05:00
Alberto Murillo ad80d0b4dd Deprecate OpenStack roles
Signed-off-by: Alberto Murillo <alberto.murillo.silva@intel.com>
2016-09-02 11:17:47 -05:00
Alberto Murillo 80494ca417 docker: Add docker role
This role installs docker 1.12 in ubuntu, fedora and clearlinux

Signed-off-by: Alberto Murillo <alberto.murillo.silva@intel.com>
2016-09-02 10:02:51 -05:00
Alberto Murillo 0545463144 ciao-controller: update mgmt_net and compute_net vars
mgmt_net and compute_net use to be a scalar value.

They are now a list of networks

Signed-off-by: Alberto Murillo <alberto.murillo.silva@intel.com>
2016-08-16 11:43:36 -05:00
Alberto Murillo d5f15caad2 ceph: sync ceph roles
Signed-off-by: Alberto Murillo <alberto.murillo.silva@intel.com>
2016-08-16 08:57:59 -05:00
Alberto Murillo f01de4d9dd ciao-network: Do not compress cnci image during transfer
The synchronize module uses rsync to transfer files between
hosts. The default behaviour is to compress the file before
transfer but tests show that it's faster to just transfer
the cnci image uncompressed.

Signed-off-by: Alberto Murillo <alberto.murillo.silva@intel.com>
2016-08-15 16:05:07 -05:00
Alberto Murillo 92d4df2fda os-keystone: Refactor code
Signed-off-by: Alberto Murillo <alberto.murillo.silva@intel.com>
2016-08-11 17:55:12 -05:00
Alberto Murillo c0a6def082 ciao: Refactor code
Signed-off-by: Alberto Murillo <alberto.murillo.silva@intel.com>
2016-08-11 14:51:21 -05:00
Alberto Murillo 20a861ea14 ciao-controller: Add a note on ciao_guest_{user,key} (#31)
These variables will setup access to ALL vm launched including
CNCI images.

This is a temporary solution for development/testing purposes
until a formal way to define per VM access from the user
perspective is available

Signed-off-by: Alberto Murillo <alberto.murillo.silva@intel.com>
2016-08-04 16:43:17 -05:00
Alberto Murillo ac18e464df ciao-controller: Create the cnci image once.
This commit creates /var/lib/ciao/images/.cnci_ready file after
it has finished with the configuration of a cnci image.

If the file exists then the cnci image setup will be skipped.

This change prevents the playbook from creating and transfering the cnci
image each time is run and only does it when its necessary.

Signed-off-by: Alberto Murillo <alberto.murillo.silva@intel.com>
2016-08-04 16:42:20 -05:00
Alberto Murillo 5ab9fa9606 ciao-controller: Fix CA Certificate handling
Tasks to retrieve and enable the controllers ca root certificate
where being marked as changed every time the playbooks runs

This commit properly handles the copy and enabling of the ca
certificate in both clearlinux and ubuntu.
2016-08-04 15:42:07 -05:00
Alberto Murillo f013bcf820 ciao-controller: Build CIAO from sources is always 'changed'
Task Build CIAO from sources is always tagged as 'changed'
even when nothing has changed

This commit tags the task as unchanged when there is no change

Signed-off-by: Alberto Murillo <alberto.murillo.silva@intel.com>
2016-08-04 13:04:15 -05:00
Alberto Murillo 07f3b6c99b ciao-network: Add support for Ubuntu 16.04 (Xenial)
Signed-off-by: Alberto Murillo <alberto.murillo.silva@intel.com>
2016-08-02 17:53:22 -05:00
Alberto Murillo e1dfb9c4ad ciao-compute: Add support for Ubuntu 16.04 (Xenial)
Signed-off-by: Alberto Murillo <alberto.murillo.silva@intel.com>
2016-08-02 17:52:53 -05:00
Alberto Murillo 3a91ad13b1 ciao-controller: Add support for Ubuntu 16.04 (Xenial)
Signed-off-by: Alberto Murillo <alberto.murillo.silva@intel.com>
2016-08-02 17:50:10 -05:00
Alberto Murillo 1cb4058703 os-keystone: Add support for Ubuntu 16.04 (Xenial)
Signed-off-by: Alberto Murillo <alberto.murillo.silva@intel.com>
2016-08-02 13:40:01 -05:00
Alberto Murillo c15fd697e0 ciao-common: Create /usr/local/bin
The playbook installs ciao binaries under
/usr/local/bin when ciao_dev is set to True.

This directory is not present by default.

Signed-off-by: Alberto Murillo <alberto.murillo.silva@intel.com>
2016-07-26 15:40:49 -05:00
Alberto Murillo 1e7bc15b39 ciao-controller: Install os-core-dev
When building CIAO from sources, gcc is required to compile
the following dependencies.

github.com/01org/ciao/vendor/github.com/vishvananda/netlink
github.com/01org/ciao/vendor/github.com/docker/docker/pkg/term
github.com/01org/ciao/vendor/github.com/mattn/go-sqlite3

Signed-off-by: Alberto Murillo <alberto.murillo.silva@intel.com>
2016-07-26 14:00:26 -05:00