Skip to content

Instantly share code, notes, and snippets.

@Michael-Brooks
Last active February 22, 2016 15:29
Show Gist options
  • Save Michael-Brooks/48e70308a557ff2c262e to your computer and use it in GitHub Desktop.
Save Michael-Brooks/48e70308a557ff2c262e to your computer and use it in GitHub Desktop.
---
- hosts: all
# TODO: Create hostname which will be added to /etc/hosts
# TODO: Create Virtual Host client which will be set as per user's configuration
# Always become super user for making server changes
become: true
# Start running the following tasks
tasks:
- include_vars: variables.yml
# CentOS 6 has an old version of Mysql so we need to remove it here for later
- name: Remove MySQL packages
yum: name={{ item }} state=removed
with_items:
- mysql-libs
- mysql
- mysql-server
# Start installing Apache
- name: Install Apache
yum: pkg=httpd
# Here we are grabbing the latest version of PHP 5.5
- name: Fetch PHP 55 Repo
yum: name=https://mirror.webtatic.com/yum/el6/latest.rpm state=present
# Install Mysql 5.5
- name: Install MySQL 55
yum: name=mysql55w state=present
# Install Mysql 5.7 Server
- name: Install MySQL Server
yum: name=mysql55w-server state=latest
- yum: pkg=MySQL-python
# We also need to start Mysql's services
- name: Start MySQL
service: name=mysqld state=started
- mysql_user: name={{ mysql_username }} password={{ mysql_password }} priv=*.*:ALL
- mysql_db: name={{ mysql_database }} state=present
# Install PHP 5.5
- name: Install PHP 55
yum: name={{ item }}
with_items:
- php55w
- php55w-mysql
- php55w-common
- php55w-opcache
- php55w-mbstring
- php55w-pdo
- php55w-mcrypt
- php55w-xml
- php55w-gd
# Now we can start Apache
- name: Start Apache
service: name=httpd state=started
- name: Install GIT
yum: pkg=git
- name: Install Composer
shell: curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/local/bin --filename=composer
- name: Update Composer
shell: /usr/local/bin/composer self-update
- composer:
command: install
working_dir: "/var/www/html"
- composer:
command: update
working_dir: "/var/www/html"
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "bento/centos-6.7"
#config.vm.provision :shell, path: "bootstrap.sh"
config.vm.network :private_network, ip: "192.168.10.10"
config.vm.provision "ansible" do |ansible|
ansible.playbook = "playbook.yml"
end
config.vm.synced_folder "../", "/home/vagrant",
mount_options: ["dmode=777,fmode=666"]
end
---
mysql_username: logo
mysql_password: l0g0d3s1gn
mysql_database: logo
TASK [setup] *******************************************************************
<127.0.0.1> ESTABLISH SSH CONNECTION FOR USER: vagrant
<127.0.0.1> SSH: EXEC ssh -C -vvv -o UserKnownHostsFile=/dev/null -o IdentitiesOnly=yes -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o Port=2222 -o 'IdentityFile="/Users/mikebrooks/sites/flarum/apache/.vagrant/machines/default/virtualbox/private_key"' -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=vagrant -o ConnectTimeout=30 -o ControlPath=/Users/mikebrooks/.ansible/cp/ansible-ssh-%h-%p-%r -tt 127.0.0.1 '( umask 22 && mkdir -p "$( echo $HOME/.ansible/tmp/ansible-tmp-1456154815.58-258102290925528 )" && echo "$( echo $HOME/.ansible/tmp/ansible-tmp-1456154815.58-258102290925528 )" )'
fatal: [default]: UNREACHABLE! => {"changed": false, "msg": "ERROR! SSH encountered an unknown error. The output was:\nOpenSSH_6.9p1, LibreSSL 2.1.8\r\ndebug1: Reading configuration data /etc/ssh/ssh_config\r\ndebug1: /etc/ssh/ssh_config line 21: Applying options for *\r\ndebug1: auto-mux: Trying existing master\r\ndebug1: Control socket \"/Users/mikebrooks/.ansible/cp/ansible-ssh-127.0.0.1-2222-vagrant\" does not exist\r\ndebug2: ssh_connect: needpriv 0\r\ndebug1: Connecting to 127.0.0.1 [127.0.0.1] port 2222.\r\ndebug2: fd 3 setting O_NONBLOCK\r\ndebug1: fd 3 clearing O_NONBLOCK\r\ndebug1: Connection established.\r\ndebug3: timeout: 30000 ms remain after connect\r\ndebug1: key_load_public: No such file or directory\r\ndebug1: identity file /Users/mikebrooks/sites/flarum/apache/.vagrant/machines/default/virtualbox/private_key type -1\r\ndebug1: key_load_public: No such file or directory\r\ndebug1: identity file /Users/mikebrooks/sites/flarum/apache/.vagrant/machines/default/virtualbox/private_key-cert type -1\r\ndebug1: Enabling compatibility mode for protocol 2.0\r\ndebug1: Local version string SSH-2.0-OpenSSH_6.9\r\ndebug1: Remote protocol version 2.0, remote software version OpenSSH_5.3\r\ndebug1: match: OpenSSH_5.3 pat OpenSSH_5* compat 0x0c000000\r\ndebug2: fd 3 setting O_NONBLOCK\r\ndebug1: Authenticating to 127.0.0.1:2222 as 'vagrant'\r\ndebug3: put_host_port: [127.0.0.1]:2222\r\ndebug3: hostkeys_foreach: reading file \"/dev/null\"\r\ndebug1: SSH2_MSG_KEXINIT sent\r\ndebug1: SSH2_MSG_KEXINIT received\r\ndebug2: kex_parse_kexinit: curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1\r\ndebug2: kex_parse_kexinit: ecdsa-sha2-nistp256-cert-v01@openssh.com,ecdsa-sha2-nistp384-cert-v01@openssh.com,ecdsa-sha2-nistp521-cert-v01@openssh.com,ssh-ed25519-cert-v01@openssh.com,ssh-rsa-cert-v01@openssh.com,ssh-dss-cert-v01@openssh.com,ssh-rsa-cert-v00@openssh.com,ssh-dss-cert-v00@openssh.com,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,ssh-ed25519,ssh-rsa,ssh-dss\r\ndebug2: kex_parse_kexinit: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysator.liu.se\r\ndebug2: kex_parse_kexinit: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysator.liu.se\r\ndebug2: kex_parse_kexinit: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1,hmac-md5-etm@openssh.com,hmac-ripemd160-etm@openssh.com,hmac-sha1-96-etm@openssh.com,hmac-md5-96-etm@openssh.com,hmac-md5,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96\r\ndebug2: kex_parse_kexinit: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1,hmac-md5-etm@openssh.com,hmac-ripemd160-etm@openssh.com,hmac-sha1-96-etm@openssh.com,hmac-md5-96-etm@openssh.com,hmac-md5,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96\r\ndebug2: kex_parse_kexinit: zlib@openssh.com,zlib,none\r\ndebug2: kex_parse_kexinit: zlib@openssh.com,zlib,none\r\ndebug2: kex_parse_kexinit: \r\ndebug2: kex_parse_kexinit: \r\ndebug2: kex_parse_kexinit: first_kex_follows 0 \r\ndebug2: kex_parse_kexinit: reserved 0 \r\ndebug2: kex_parse_kexinit: diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1\r\ndebug2: kex_parse_kexinit: ssh-rsa,ssh-dss\r\ndebug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysator.liu.se\r\ndebug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysator.liu.se\r\ndebug2: kex_parse_kexinit: hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96\r\ndebug2: kex_parse_kexinit: hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96\r\ndebug2: kex_parse_kexinit: none,zlib@openssh.com\r\ndebug2: kex_parse_kexinit: none,zlib@openssh.com\r\ndebug2: kex_parse_kexinit: \r\ndebug2: kex_parse_kexinit: \r\ndebug2: kex_parse_kexinit: first_kex_follows 0 \r\ndebug2: kex_parse_kexinit: reserved 0 \r\ndebug1: kex: server->client aes128-ctr umac-64@openssh.com zlib@openssh.com\r\ndebug1: kex: client->server aes128-ctr umac-64@openssh.com zlib@openssh.com\r\ndebug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<3072<8192) sent\r\ndebug1: got SSH2_MSG_KEX_DH_GEX_GROUP\r\ndebug2: bits set: 1563/3072\r\ndebug1: SSH2_MSG_KEX_DH_GEX_INIT sent\r\ndebug1: got SSH2_MSG_KEX_DH_GEX_REPLY\r\ndebug1: Server host key: ssh-rsa SHA256:JrjYPLrMo1JYvJ4MjSsct1yYJ6gt/XXqvz9JYECUyVM\r\ndebug3: put_host_port: [127.0.0.1]:2222\r\ndebug3: put_host_port: [127.0.0.1]:2222\r\ndebug3: hostkeys_foreach: reading file \"/dev/null\"\r\ndebug1: checking without port identifier\r\ndebug3: hostkeys_foreach: reading file \"/dev/null\"\r\nWarning: Permanently added '[127.0.0.1]:2222' (RSA) to the list of known hosts.\r\ndebug2: bits set: 1549/3072\r\ndebug2: set_newkeys: mode 1\r\ndebug1: SSH2_MSG_NEWKEYS sent\r\ndebug1: expecting SSH2_MSG_NEWKEYS\r\ndebug2: set_newkeys: mode 0\r\ndebug1: SSH2_MSG_NEWKEYS received\r\ndebug1: Roaming not allowed by server\r\ndebug1: SSH2_MSG_SERVICE_REQUEST sent\r\ndebug2: service_accept: ssh-userauth\r\ndebug1: SSH2_MSG_SERVICE_ACCEPT received\r\ndebug2: key: /Users/mikebrooks/sites/flarum/apache/.vagrant/machines/default/virtualbox/private_key (0x0), explicit\r\ndebug1: Authentications that can continue: publickey,password\r\ndebug3: start over, passed a different list publickey,password\r\ndebug3: preferred gssapi-with-mic,gssapi-keyex,hostbased,publickey\r\ndebug3: authmethod_lookup publickey\r\ndebug3: remaining preferred: ,gssapi-keyex,hostbased,publickey\r\ndebug3: authmethod_is_enabled publickey\r\ndebug1: Next authentication method: publickey\r\ndebug1: Trying private key: /Users/mikebrooks/sites/flarum/apache/.vagrant/machines/default/virtualbox/private_key\r\ndebug3: sign_and_send_pubkey: RSA SHA256:woU8MqKbYobj0laOb3hBStsgSVCQkLpzpKviZhI7jBs\r\ndebug2: we sent a publickey packet, wait for reply\r\ndebug1: Authentications that can continue: publickey,password\r\ndebug2: we did not send a packet, disable method\r\ndebug1: No more authentication methods to try.\r\nPermission denied (publickey,password).\r\n", "unreachable": true}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment