This file contains 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
Vagrant.configure("2") do |config| | |
config.vm.box = "base" | |
# strat with Vagrant configuration v2 need specify VM provider | |
config.vm.provider :virtualbox do |vb| | |
file_to_disk = '/tmp/large_disk.vdi' | |
# disk size 50GB | |
vb.customize ['createhd', '--filename', file_to_disk, '--size', 50 * 1024] | |
vb.customize ['storageattach', :id, '--storagectl', 'SATA', '--port', 1, '--device', 0, '--type', 'hdd', '--medium', file_to_disk] | |
end |
This file contains 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
VboxManage storagectl VMNAME --name CD --add ide --controller PIIX4 | |
VboxManage storageattach VMNAME --storagectl CD --type dvddrive --port 0 --device 0 --medium emptydrive |
This file contains 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: default | |
user: vagrant | |
gather_facts: false | |
sudo: true | |
tasks: | |
- name: Ensure gcc installed | |
yum: name=gcc state=present |
This file contains 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
module logwatch_nfs_write 1.0; | |
require { | |
type logwatch_t; | |
type nfs_t; | |
class dir write; | |
} | |
#============= logwatch_t ============== | |
#!!!! The source type 'logwatch_t' can write to a 'dir' of the following types: |
This file contains 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: default | |
gather_facts: false | |
sudo: true | |
vars: | |
kibana: https://download.elasticsearch.org/kibana/kibana/kibana-3.1.0.tar.gz | |
kbver: 3.1.0 | |
es: https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.3.2.noarch.rpm | |
ls: https://download.elasticsearch.org/logstash/logstash/packages/centos/logstash-1.4.2-1_2c0f5a1.noarch.rpm | |
tasks: |
This file contains 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: Red Hat - Check subscription status | |
shell: /usr/sbin/subscription-manager list | |
register: subs | |
when: ansible_distribution == 'RedHat' | |
- name: Red Hat - Ensure registered to RHN (1/2) | |
shell: /usr/sbin/subscription-manager register --username USER --password PASS | |
when: ansible_distribution == 'RedHat' and "Subscribed" not in subs.stdout |
This file contains 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: | |
- group_by: key={{ ansible_virtualization_type }} | |
# Include *all* groups here | |
- include: webservers.yml | |
## |
This file contains 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
.PHONY: run test | |
# default inventory file | |
INV ?= dev | |
# default play | |
PLAY ?= site | |
# If a variable file is encrypted with Vault, create a file with the password | |
# in and run the make with SWITCHES including '--vault-password-file FILE'. | |
# Naturally DO NOT put that file in Git! |
This file contains 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
host1.vm.provider :vmware_fusion do |vmw| | |
vdiskmanager = '/Applications/VMware\ Fusion.app/Contents/Library/vmware-vdiskmanager' | |
dir = "#{ENV['PWD']}/.vagrant/additional-disks" | |
unless File.directory?( dir ) | |
Dir.mkdir dir | |
end | |
file_to_disk = "#{dir}/hd2.vmdk" | |
unless File.exists?( file_to_disk ) | |
`#{vdiskmanager} -c -s 10GB -a lsilogic -t 0 #{file_to_disk}` | |
end |
This file contains 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: Ensure hostname set | |
hostname: | |
name: {{ inventory_hostname }} | |
when: not inventory_hostname|trim is match('(\d{1,3}\.){3}\d{1,3}') | |
- name: Ensure hostname is in /etc/hosts | |
lineinfile: | |
dest: /etc/hosts | |
regexp: "^{{ ansible_default_ipv4.address }}.+$" | |
line: "{{ ansible_default_ipv4.address }} {{ ansible_fqdn }} {{ ansible_hostname }}" |
OlderNewer