This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
variable "name" { | |
default = "test" | |
} | |
variable "region" { | |
default = "ap-northeast-1" | |
} | |
variable "vpc_cidr" { | |
default = "172.16.0.0/16" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
pip install ansible |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
variable "name" { default = "test" } | |
variable "region" { default = "ap-northeast-1" } | |
variable "access_key" { } | |
variable "secret_key" { } | |
variable "vpc_cidr" { default = "172.16.0.0/16" } | |
variable "az" { default = "ap-northeast-1a" } | |
variable "public_subnet" { default = "172.16.0.0/24" } | |
variable "web_instance_type" { default = "t2.micro" } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- name: Check if hoge in fuga | |
shell: | | |
grep -F 'hoge' roles/test/files/path/to/fuga | |
register: res | |
always_run: yes | |
failed_when: no | |
changed_when: res.rc == 0 | |
notify: | |
- Ping only if hoge in fuga |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#compdef apex | |
function _apex() { | |
local context curcontext=$curcontext state line | |
typeset -A opt_args | |
local ret=1 | |
_arguments -C \ | |
'(-C --chdir)'{-C,--chdir}'[<string> Working directory]' \ | |
'(-D --dry-run)'{-D,--dry-run}'[Perform a dry-run]' \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'spec_helper' | |
describe 'www.example.com' do | |
it { is_expected.to have_dns.with_type('A') } | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- name: Ansible tips | |
connection: local | |
hosts: localhost | |
tasks: | |
- name: Ping only if OSX | |
ping: | |
when: "{{ lookup('pipe', 'uname -s') | match('Darwin') }}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- name: Test serial | |
hosts: test | |
serial: 2 | |
tasks: | |
- name: task1 | |
ping: | |
- name: task2 | |
ping: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
variable "name" { default = "test" } | |
variable "region" { default = "ap-northeast-1" } | |
variable "vpc_cidr" { default = "172.16.0.0/16" } | |
variable "az" { default = "ap-northeast-1a" } | |
variable "public_subnet" { default = "172.16.0.0/24" } | |
variable "web_instance_type" { default = "t2.micro" } | |
variable "web_instance_ami_id" { default = "ami-383c1956" } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- hosts: all | |
tasks: | |
- name: Create a group of all hosts by operating system | |
group_by: key={{ansible_distribution}}-{{ansible_distribution_version}} | |
# the following host group does not exist in inventory and was created by the group_by | |
# module. |