# Anything in this file can be overridden in config.yml.
#
vm:
  # Override this in config.yml if you want to bring up the
  # postgres box, and if you want to automatically configure chef-server
  # to use it as an externally managed postgres instance.
  postgresql:
    # enable a separate postgres vm but do not use it unless
    # use-vm-for-external is set.
    start: false
    # When this is set true, and start is true,
    # the chef-server node will be configured to use
    # this vm as an external postgresql server from the start.
    use-external: true
  # Override this in config.yml if you want to bring up a separate reporting
  # postgres box, and if you want to automatically configure chef-server
  # to use it as an externally managed reporting postgres instance.
  reporting_postgresql:
    # enable a separate postgres vm but do not use it unless
    # use-vm-for-external is set.
    start: false
    # When this is set true, and start is true,
    # chef reporting will be configured to use
    # this vm as an external postgresql server from the start.
    use-external: true

  # All settings below apply only to the chef-server vm
  cpus: 4
  memory: 4096
  packages: [ ntp, curl, wget, htop, uuid-dev, tmux, vim, iotop ]
  omnibus-autoload: [] # see config.yml for details and to add components
  # Override this in config.yml to set a custom path for your dotfiles
  # that's external to this repository.
  dotfile_path: dotfiles
  # TODO whitelist as well?
  # Note that we can't exclude .git from top-level projects, and by extension from anything,
  # otherwise rebar commands begin to fail.
  sync:
  # In local tests, it is about a 1.1 seconds per sync,
  # with up to about 15 seconds for a large sync (400mb single file)
  # CPU usage on the host is minimal, but for large syncs does increase
  # significantly on the guest.
     interval: 5
     show-syncing-message: true
     exclude-files:
       - pkg/
       - deps/
       - rel/
       - _rel/
       - _build/
       - chef-mover/rel/mover/
       - ebin/
       - .eunit/
       - .kitchen/
       - .bundle/
       - vendor/bundle/
       - "*_SUITE_data/"
       - "*.deb"
       - "*.rpm"
       - "*.vmdk"
       - "*.plt"
       - "*.beam"
       - "*.o"
       - "*.so"
       - "*.d"
       - logs/
       - /dev/
       - .concrete/
       - relx # we don't want to pull in a mac relx to our linux vm
       - rspec.failures
       - VERSION
       - partybus/config.rb
       - oc-reporting-pedant/Gemfile.lock # friggin ugh

  cover:
    base_output_path: /vagrant/testdata/cover # maps to dev/testdata/cover
  node-attributes:
    placeholder: true

projects:
  oc_erchef:
    type: erlang
    database: opscode_chef # Used for dvm psql oc_erchef
    service:
      rel-type: rebar3
      name: opscode-erchef
      cookie: erchef
      node: erchef@127.0.0.1
  oc-id:
    type: ruby
    service:
      name: oc_id
  oc_bifrost:
    type: erlang
    database: bifrost
    service:
      rel-type: rebar3
      name:  oc_bifrost
      cookie: oc_bifrost
      node: oc_bifrost@127.0.0.1
  oc_reporting:
    type:  erlang
    external: true
    make-target: compile generate rel
    database: opscode_reporting
    omnibus-project: opscode-reporting
    service:
     rel-type: reltool
     name: opscode-reporting
     rel-name: oc_reporting
     cookie: oc_reporting
     node: oc_reporting@127.0.0.1
  chef-mover:
    type: erlang
    service:
      rel-type: rebar3
      rel-name: mover
      name:  opscode-chef-mover
      cookie: mover
      node: mover@127.0.0.1
  bookshelf:
    type: erlang
    service:
      rel-type: rebar3
      name: bookshelf
      cookie: bookshelf
      node: bookshelf@127.0.0.1
  omnibus:
    path: "omnibus"
    name: opscode-omnibus
    type: omnibus
    components:
      # dest paths are relative to /opt/opscode/embedded for these components
      # source apths are relative to opscode-omnibus/files
      private-chef-cookbooks:
        source_path: private-chef-cookbooks/private-chef
        dest_path: /opt/opscode/embedded/cookbooks/private-chef
        reconfigure_on_load: true
      ctl-commands:
        source_path: private-chef-ctl-commands
        dest_path: /opt/opscode/embedded/service/omnibus-ctl
        reconfigure_on_load: false
      upgrades:
        source_path: private-chef-upgrades
        dest_path: /opt/opscode/embedded/upgrades
        reconfigure_on_load: false
      ha-drbd-cookbook:
        source_path: private-chef-cookbooks/chef-ha-drbd
        dest_path: /opt/opscode/embedded/cookbooks/chef-ha-drbd
        reconfigure_on_load: true
      partybus:
        source_path: ../partybus
        dest_path: /opt/opscode/embedded/service/partybus
        reconfigure_on_load: false
        bundler: true
  oc-chef-pedant:
    type: ruby
    path: oc-chef-pedant
    database: opscode_chef
    run: bin/oc-chef-pedant -c /var/opt/opscode/oc-chef-pedant/etc/pedant_config.rb

  #
  # External Components
  # We'll eventually allow external projects to supply their own
  # 'dvm.yml' that we can include for project definitions, but for now...

  #
  # omnibus-ctl
  #
  omnibus-ctl:
    type: ruby
    system: true
    external: true

  #
  # Reporting
  #
  omnibus-reporting:
    name: omnibus-reporting
    type: omnibus
    external: true
    components:
      reporting-cookbooks:
        source_path: cookbooks/opscode-reporting
        dest_path: /opt/opscode-reporting/embedded/cookbooks/opscode-reporting
        ctl-name: opscode-reporting-ctl
        reconfigure_on_load: true
      ctl-commands:
        source_path: opscode-reporting-ctl-commands
        dest_path: /opt/opscode-reporting/embedded/service/omnibus-ctl
        reconfigure_on_load: false
  oc-reporting-pedant:
    type: ruby
    external: true
    gem-path: /opt/opscode-reporting/embedded/service/gems
    run: ./oc-reporting-pedant -c /etc/opscode-reporting/pedant_config.rb

quickstart:
  chef-server:
    description: "Load up all the things used for most chef server dev: pedant, cookbooks, commands, erchef.  Starts oc_erchef without a console."
    load:
      - omnibus private-chef-cookbooks
      - omnibus ctl-commands
      - oc-chef-pedant
      - oc_erchef
    start:
      - oc_erchef

  oc_erchef:
    description: "Load up erchef and start it in console mode."
    load:
      - oc_erchef
    start:
      - oc_erchef

  oc_bifrost:
    description: "Load oc_bifrost and oc-bifrost-pedant from /host. Start oc_bifrost into a console."
    load:
      - oc_bifrost
    start:
      - oc_bifrost
