infrastructure

Ideal terraform workspace project structure

强颜欢笑 提交于 2019-12-04 05:05:20
I'd like to setup Terraform to manage dev/stage/prod environments. The infrastructure is the same in all environments, but there are differences in the variables in every environment. What does an ideal Terraform project structure look like now that workspaces have been introduced in Terraform 0.10? How do I reference the workspace when naming/tagging infrastructure? I wouldn't recommend using workspaces (previously 'environments') for static environments because they add a fair bit of complexity and are harder to keep track of. You could get away with using a single folder structure for all

How to show maintenance page during deployment?

白昼怎懂夜的黑 提交于 2019-12-03 18:01:08
问题 I want to plan a schedule maintenance down time on one of my production asp.net website hosted on IIS windows server 2003. I think this is the preferred behavior: All request to http://www.x.com including www.x.com/asb/asd/ will be redirected to a notification page (site is currently down. come back later) The maintenance will take around an hour. how do I ensure for having this redirection to maintenance page to have the least impact to SEO/google ranking Preferrably I want to be able to

Copy local file if exists, using ansible

孤街浪徒 提交于 2019-12-03 09:38:26
I'm working in a project, and we use ansible to create a deploy a cluster of servers. One of the tasks that I've to implement, is to copy a local file to the remote host, only if that file exists locally. Now I'm trying to solve this problem using this - hosts: 127.0.0.1 connection: local tasks: - name: copy local filetocopy.zip to remote if exists - shell: if [[ -f "../filetocopy.zip" ]]; then /bin/true; else /bin/false; fi; register: result - copy: src=../filetocopy.zip dest=/tmp/filetocopy.zip when: result|success Bu this is failing with the following message: ERROR: 'action' or 'local

Django: how to serve user-submitted images & thumbnails from separate, multiple servers?

柔情痞子 提交于 2019-12-03 07:56:39
问题 For my Django site, I'd like to: Accept images submitted by users Generate thumbnails from those images Put both the original images and the thumbnails onto separate, multiple servers that are dedicated to serving images I need multiple, separate servers to serve the images/thumbnails to ensure I have enough IO performance. What is the best way to build a distributed image serving system like this? Any open source software that would help? Thanks. 回答1: This sounds like a job for distributed

Terraform terraform_remote_state Partial Configuration

淺唱寂寞╮ 提交于 2019-12-01 13:15:25
My team relies heavily on S3 remote state from within Terraform. We use the -backend-config feature of the CLI to specify the S3 configuration when initializing projects, so our actual terraform code looks like: terraform { backend "s3" {} } The above works great as long as all the S3 attributes are specified on the CLI with -backend-config . We would like to use a similar strategy for referencing these states elsewhere in our configurations. Since the parameters for the backend are dynamic and specified on the CLI, we are looking to do the same. data "terraform_remote_state" "dns" { backend =

Terraform terraform_remote_state Partial Configuration

六眼飞鱼酱① 提交于 2019-12-01 12:23:30
问题 My team relies heavily on S3 remote state from within Terraform. We use the -backend-config feature of the CLI to specify the S3 configuration when initializing projects, so our actual terraform code looks like: terraform { backend "s3" {} } The above works great as long as all the S3 attributes are specified on the CLI with -backend-config . We would like to use a similar strategy for referencing these states elsewhere in our configurations. Since the parameters for the backend are dynamic

Vagrant in production

折月煮酒 提交于 2019-11-29 22:52:45
I've been reading about Vagrant, and I find it quite useful for my development. I am currently managing a series of services (mail, web, LDAP, file sharing, etc.), and often one of these falls and needs a quick backup. Is it possible (and recommended) to use Vagrant for these purposes? So far I've virtual machines installed like real machines. I would also like to know about an alternative to Vagrant which would allow me to setup a simple configuration file and put a virtual machine, for example, with Zimbra, and quickly have an alternate mail server, enable RabbitMQ, etc. Vagrant should be

'Not a valid output for module' when using output variable with terraform

余生颓废 提交于 2019-11-29 11:30:16
I'm trying to setup some IaC for a new project using Hashicorp Terraform on AWS. I'm using modules because I want to be able to reuse stuff across multiple environments (staging, prod, dev, etc.) I'm struggling to understand where I have to set an output variable within a module, and how I then use that in another module. Any pointers to this would be greatly appreciated! I need to use some things created in my VPC module (subnet IDs) when creating EC2 machines. My understanding is that you can't reference something from one module in another, so I am trying to use an output variable from the

How to show maintenance page during deployment?

◇◆丶佛笑我妖孽 提交于 2019-11-29 05:33:34
I want to plan a schedule maintenance down time on one of my production asp.net website hosted on IIS windows server 2003. I think this is the preferred behavior: All request to http://www.x.com including www.x.com/asb/asd/ will be redirected to a notification page (site is currently down. come back later) The maintenance will take around an hour. how do I ensure for having this redirection to maintenance page to have the least impact to SEO/google ranking Preferrably I want to be able to quietly test the production site before it goes back 'live' Preferrably I dont want to rely on pointing

Vagrant in production

人盡茶涼 提交于 2019-11-28 19:42:48
问题 I've been reading about Vagrant, and I find it quite useful for my development. I am currently managing a series of services (mail, web, LDAP, file sharing, etc.), and often one of these falls and needs a quick backup. Is it possible (and recommended) to use Vagrant for these purposes? So far I've virtual machines installed like real machines. I would also like to know about an alternative to Vagrant which would allow me to setup a simple configuration file and put a virtual machine, for