fusor / apb-examples

A repository of example ansible-playbook bundles. THIS REPO IS DEPRECATED. Please look at https://github.com/ansibleplaybookbundle/ For updated examples.
13 stars 26 forks source link

change to use better format #41

Closed jmrodri closed 7 years ago

jmrodri commented 7 years ago

Based on recent email discussion, the old format would generate a map of arrays of maps. This new format will generate a map of maps.

jmrodri commented 7 years ago

NEW FORMAT

parameters:
  - mediawiki_db_schema:
      title: Mediawiki DB Schema
      type: string
      default: mediawiki
  - mediawiki_site_name:
      title: Mediawiki Site Name
      type: string
      default: MediaWiki
  - mediawiki_site_lang:
      title: Mediawiki Site Language
      type: string
      default: en
  - mediawiki_admin_user:
      title: Mediawiki Admin User
      type: string
      default: admin
  - mediawiki_admin_pass:
      title: Mediawiki Admin User Password
      type: string

RESULT

{
  "parameters": [
    {
      "mediawiki_db_schema": {
        "default": "mediawiki", 
        "type": "string", 
        "title": "Mediawiki DB Schema"
      }
    }, 
    {
      "mediawiki_site_name": {
        "default": "MediaWiki", 
        "type": "string", 
        "title": "Mediawiki Site Name"
      }
    }, 
    {
      "mediawiki_site_lang": {
        "default": "en", 
        "type": "string", 
        "title": "Mediawiki Site Language"
      }
    }, 
    {
      "mediawiki_admin_user": {
        "default": "admin", 
        "type": "string", 
        "title": "Mediawiki Admin User"
      }
    }, 
    {
      "mediawiki_admin_pass": {
        "type": "string", 
        "title": "Mediawiki Admin User Password"
      }
    }
  ]
}
jmrodri commented 7 years ago

OLD FORMAT

parameters:
  - mediawiki_db_schema:
    - title: Mediawiki DB Schema
      type: string
      default: mediawiki
  - mediawiki_site_name:
    - title: Mediawiki Site Name
      type: string
      default: MediaWiki
  - mediawiki_site_lang:
    - title: Mediawiki Site Language
      type: string
      default: en
  - mediawiki_admin_user:
    - title: Mediawiki Admin User
      type: string
      default: admin
  - mediawiki_admin_pass:
    - title: Mediawiki Admin User Password
      type: string

RESULT

{
  "parameters": [
    {
      "mediawiki_db_schema": [
        {
          "default": "mediawiki", 
          "type": "string", 
          "title": "Mediawiki DB Schema"
        }
      ]
    }, 
    {
      "mediawiki_site_name": [
        {
          "default": "MediaWiki", 
          "type": "string", 
          "title": "Mediawiki Site Name"
        }
      ]
    }, 
    {
      "mediawiki_site_lang": [
        {
          "default": "en", 
          "type": "string", 
          "title": "Mediawiki Site Language"
        }
      ]
    }, 
    {
      "mediawiki_admin_user": [
        {
          "default": "admin", 
          "type": "string", 
          "title": "Mediawiki Admin User"
        }
      ]
    }, 
    {
      "mediawiki_admin_pass": [
        {
          "type": "string", 
          "title": "Mediawiki Admin User Password"
        }
      ]
    }
  ]
}