<commit_before>#
# CloudConductor Pattern:: vnet_pattern
# Name:: task.yml
#
# Copyright 2015, TIS Inc.
#
# All rights reserved - Do Not Redistribute
#

#
# Environments
#
environments:
  HOME: /root
  PATH: $PATH:/opt/chefdk/embedded/bin:/opt/chef/embedded/bin:/usr/bin
  ROLE: '{{config.role}}'
  CONSUL_SECRET_KEY: '{{config.token}}'

#
# Variables
#
# be defined the key-value map to use in this task.yml file.
#
# variables:

#
# Default
#
# be defined the default value of parameters.
#
default:
  timeout: 1800

#
# Events
#
events:
  setup:
    description: Execute setup
    task: dummy

  configure:
    description: Execute configure
    priority: 10
    ordered_tasks:
      - task: prepare
      - service: vnet-vnmgr
        task: configure_vnet
      - task: configure_nodes
      - service: vnet-vna
        task: configure_edge
      - service: vnet-vnmgr
        task: configure_mgr
      - service: vnet-vna
        task: start_vna

  deploy:
    description: Execute deploy
    task: dummy

  backup:
    description: Execute backup
    task: dummy

  restore:
    description: Execute restore
    task: dummy

  spec:
    description: Execute spec
    task: serverspec

#
# Tasks
#
tasks:
  dummy:
    description: Execute dummy
    service: vnet-vnmgr
    operations:
      - chef:
          run_list:
            - role[{{role}}_dummy]

  prepare:
    description: Execute prepare
    service: vnet-vnmgr
    operations:
      - execute:
          file: prepare.sh

  configure_vnet:
    description: Execute configure of vnet
    service: vnet-vnmgr
    operations:
      - chef:
          run_list:
            - recipe[vnet_part::vnet_configure]

  configure_nodes:
    description: Execute configure of nodes
    operations:
      - chef:
          run_list:
            - recipe[vnet_part::vnet_node]

  configure_edge:
    description: Execute configure of edge
    service: vnet-vna
    operations:
      - chef:
          run_list:
            - recipe[vnet_part::vnet_edge]

  configure_mgr:
    description: Execute configure of mgr
    service: vnet-vnmgr
    operations:
      - chef:
          run_list:
            - recipe[vnet_part::vnet_mgr]
            - recipe[vnet_part::vnet_dataset]

  start_vna:
    description: Run vna service
    service: vnet-vna
    operations:
      - execute:
          script: |
            initctl status vnet-vna | grep running
            if [ $? -ne 0 ]; then
              initctl start vnet-vna
            fi

  serverspec:
    description: Execute serverspec
    operations:
      - execute:
          script: ./run_serverspec.sh {{config.role}}
<commit_msg>Add default parameter for chef operation<commit_after>#
# CloudConductor Pattern:: vnet_pattern
# Name:: task.yml
#
# Copyright 2015, TIS Inc.
#
# All rights reserved - Do Not Redistribute
#

#
# Environments
#
environments:
  HOME: /root
  PATH: $PATH:/opt/chefdk/embedded/bin:/opt/chef/embedded/bin:/usr/bin
  ROLE: '{{config.role}}'
  CONSUL_SECRET_KEY: '{{config.token}}'

#
# Variables
#
# be defined the key-value map to use in this task.yml file.
#
# variables:

#
# Default
#
# be defined the default value of parameters.
#
default:
  timeout: 1800
  chef:
    attribute_keys:
      - cloudconductor

#
# Events
#
events:
  setup:
    description: Execute setup
    task: dummy

  configure:
    description: Execute configure
    priority: 10
    ordered_tasks:
      - task: prepare
      - service: vnet-vnmgr
        task: configure_vnet
      - task: configure_nodes
      - service: vnet-vna
        task: configure_edge
      - service: vnet-vnmgr
        task: configure_mgr
      - service: vnet-vna
        task: start_vna

  deploy:
    description: Execute deploy
    task: dummy

  backup:
    description: Execute backup
    task: dummy

  restore:
    description: Execute restore
    task: dummy

  spec:
    description: Execute spec
    task: serverspec

#
# Tasks
#
tasks:
  dummy:
    description: Execute dummy
    service: vnet-vnmgr
    operations:
      - chef:
          run_list:
            - role[{{role}}_dummy]

  prepare:
    description: Execute prepare
    service: vnet-vnmgr
    operations:
      - execute:
          file: prepare.sh

  configure_vnet:
    description: Execute configure of vnet
    service: vnet-vnmgr
    operations:
      - chef:
          run_list:
            - recipe[vnet_part::vnet_configure]

  configure_nodes:
    description: Execute configure of nodes
    operations:
      - chef:
          run_list:
            - recipe[vnet_part::vnet_node]

  configure_edge:
    description: Execute configure of edge
    service: vnet-vna
    operations:
      - chef:
          run_list:
            - recipe[vnet_part::vnet_edge]

  configure_mgr:
    description: Execute configure of mgr
    service: vnet-vnmgr
    operations:
      - chef:
          run_list:
            - recipe[vnet_part::vnet_mgr]
            - recipe[vnet_part::vnet_dataset]

  start_vna:
    description: Run vna service
    service: vnet-vna
    operations:
      - execute:
          script: |
            initctl status vnet-vna | grep running
            if [ $? -ne 0 ]; then
              initctl start vnet-vna
            fi

  serverspec:
    description: Execute serverspec
    operations:
      - execute:
          script: ./run_serverspec.sh {{config.role}}

{'fraction_non_alphanumeric': 0.08725710014947684, 'fraction_numerical': 0.004110612855007474, 'mean_word_length': 2.1655824955647547, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2571451', 'n_tokens_mistral': 1749, 'n_tokens_neox': 1681, 'n_words': 428}