0

I have multiple hosts (web servers) per environment. How do I define this in hosts.yml? The following returns an array error.

hosts:
    uat:
        hostname: 
          - 10.20.30.50
        remote_user: someuser
        port: 22
        forwardAgent: true
        multiplexing: true
        ssh_arguments: ['-o UserKnownHostsFile=/dev/null','-o StrictHostKeyChecking=no']
        stage: uat
        deploy_path: "/var/www/vhosts/mywebapp/"
        
    production:
        hostname: 
          - 10.20.30.40
          - 10.20.30.41
          - 10.20.30.42
        remote_user: someuser
        port: 22
        forwardAgent: true
        multiplexing: true
        ssh_arguments: ['-o UserKnownHostsFile=/dev/null','-o StrictHostKeyChecking=no']
        stage: production
        deploy_path: "/var/www/vhosts/mywebapp/"
Confounder
  • 469
  • 1
  • 8
  • 23

1 Answers1

0

It's work for me:

prod_backend:
    host: 10.0.0.1
    user: developer
    port: 22
    identity_file: ~
    deploy_path: /var/www/app
    stage: production
    keep_releases: 5

prod_frontend:
    host: 10.0.0.2
    user: developer
    port: 22
    identity_file: ~
    deploy_path: /var/www/app
    stage: production
    keep_releases: 5

command for exec:

./dep --no-ansi -p deploy:unlock production