Creating a separate role with a task

Creating a separate role with a taskΒΆ

You can create a separate role and attach a custom task to that role. Examples in this section describe installation of a Redis database server. You can apply similar principles for other tasks.

Warning

We recommend that you add new roles through creating plugins.

To create a separate role with a task:

  1. Create a .yaml file with a user-friendly name.

    For example, redis.yaml.

  2. Open the file for editing and add meta information:

    Example:

    meta:
      description: Simple Redis server
      name: Controller
    name: redis
    volumes_roles_mapping:
      - allocate_size: min
        id: os
    
  3. Create a role using Fuel CLI:

    fuel role --rel 1 --create --file <my.yaml>
    

    Example:

    fuel role --rel 1 --create --file redis.yaml
    
  4. Log in to the Fuel Web UI.

  5. In the Nodes tab, verify that the required role is created.

  6. Attach a task to the newly created role:

    1. Log in to Fuel CLI.

    2. Install the required Puppet modules.

      Example:

      puppet module install thomasvandoren-redis
      
    3. Write a simple manifest to the required location. For example: /etc/puppet/modules/redis/example/simple_redis.pp and include redis.

    4. Create a deployment task in you tasks.yaml. For example, in /etc/puppet/modules/redis/example/redis_tasks.yaml.

      Example:

       # redis group
       - id: redis
         type: group
         role: [redis]
         required_for: [deploy_end]
         tasks: [globals, hiera, netconfig, install_redis]
         parameters:
         strategy:
         type: parallel
      
      # Install simple redis server
      - id: install_redis
        type: puppet
        requires: [netconfig]
        required_for: [deploy_end]
        parameters:
          puppet_manifest: /etc/puppet/modules/redis/example/simple_redis.pp
          puppet_modules: /etc/puppet/modules
          timeout: 180
      
    5. Synchronize deployment tasks:

      fuel rel --sync-deployment-tasks --dir <path-to-puppet-manifest>
      

      Example:

      fuel rel --sync-deployment-tasks --dir /etc/puppet/mitaka-9.0/
      
    6. Configure and create an OpenStack environment with all required network, storage, and other settings.

    7. Provision a node with the created role:

      Example:

      fuel node --node <node_ID> --env <env_ID> --provision
      
    8. Deploy a node with the created role:

      fuel node --node <node_ID> --env <env_ID> --deploy
      
Creative Commons Attribution 3.0 License

Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.

Contents