terraform script for odoo deployment

1

I have the following scrip

terraform {                                                                                                                                                
   required_version = ">=0.10.6"                                                                                                                              
}

provider "rancher" {                                                                                                                                           
   api_url = "http://1xx.xxx.xx.15:8080"                                                                                                                        
   access_key = "F4xxxxxxxxxxx9"                                                                                                                          
   secret_key = "MVxxxxxxxxxxxxxxxxx2x3YXfqieHtG"                                                                                                    
}  

resource "rancher_environment" "production" {                                                                                                                  
   name = "production"                                                                                                                                          
   description = "Production Environment"                                                                                                                       
   orchestration = "kubernetes"                                                                                                                                                                                                                                                                                            
}      

resource "rancher_environment" "staging" {                                                                                                                     
   name = "stagin"                                                                                                                                              
   description = "Stagin Environment"                                                                                                                           
   orchestration = "kubernetes"                                                                                                                                                                                                                                                                                        
}                                                                                                                                                                                                                                                                                                                     

provider "postgresql" {                                                                                                                                        
    host   = "1xx.xxx.xx.15"                                                                                                                            
    port            = 5432                                                                                                                                       
    database        = "postgres"                                                                                                                                 
    username        = "odoo"                                                                                                                                     
    password        = "odoo"                                                                                                                                     
connect_timeout = 15                                                                                                                                       
}

resource "docker_container" "db" {                                                                                                                             
    image = "ikusolutions/postgres:10"                                                                                                                           
    name = "db"                                                                                                                                                  
    restart = "always"                                                                                                                                           
    hostname = "1xx.xxx.xx.15"                                                                                                                                   
    env   = ["production"]                                                                                                                                     
}   

resource "docker_container" "Odoo-iku" {                                                                                                                       
    name  = "Odoo-iku"                                                                                                                                           
    image = "ikusolutions/odoo-iku:latest"                                                                                                                       
    links = ["db"]                                                                                                                                               
    ports {                                                                                                                                                        
       external = 8070                                                                                                                                              
       internal = 8069                                                                                                                                            
   }                                                                                                                                                            
   hostname = "iku"                                                                                                                                             
   domainname = "iku.solutions"                                                                                                                                 
   restart = "always"                                                                                                                                           
   env   = ["production"]                                                                                                                                     
}

resource "docker_container" "Odoo-intech" {                                                                                                                    
   name  = "Odoo-intech"                                                                                                                                        
   image = "ikusolutions/odoo-iku:latest"                                                                                                                       
   links = ["db"]                                                                                                                                               
   ports {                                                                                                                                                        
     external = 8071                                                                                                                                              
     internal = 8069                                                                                                                                            
   }

   hostname = "intech"                                                                                                                                          
   domainname = "iku.solutions"                                                                                                                                 
   restart = "always"                                                                                                                                        
   env   = ["production"]                                                                        
}

But the instance is not shown, the following error appears ... I think it does not have access to the database.

::: reference image :::

Any ideas ???

    
asked by 01.05.2018 в 23:14
source

0 answers