Skip to content

Instantly share code, notes, and snippets.

View sbeliakou's full-sized avatar

Siarhei Beliakou sbeliakou

View GitHub Profile
#!/bin/sh
if [ $(id -u) -ne 0 ]; then
mkdir -p ~/.ssh
chmod 740 ~/.ssh
cat << EOK >> ~/.ssh/authorized_keys
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCdZKIyemoAAokcoPxEAtKcV1qZbing5LnNjakHahX4QCt9TNR/2ss2DD1ZH3z/1goxvCdLCsn2WHOdwpPr9McWtBIeDQhl7nsx8n0wPnLckJLGfeb7INjlUb0LYAMBwEAURzyb7LYy2gspHK8fV9Sqp/A1YKeCoO/oxwEeVy/kaa0Q6tJt0xynEtIj4t1oA3k0USkythS6Wpi9XFUIUEOiGqYCKpSyJiHXmQlGTvY137OrQgdAUbv+Vy4h14YH322C+TTgi15fXsr+N2YWcV3rmLCeyYiMrC8Ndsm8pzE/0BzI3toSNVlOD1SIo3kIjUo8zB0XfoH1Yvku+MOTESqz playpit
EOK
#!/bin/sh
if [ $(id -u) -ne 0 ]; then
mkdir -p ~/.ssh
chmod 640 ~/.ssh
cat << EOK >> ~/.ssh/authorized_keys
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCdZKIyemoAAokcoPxEAtKcV1qZbing5LnNjakHahX4QCt9TNR/2ss2DD1ZH3z/1goxvCdLCsn2WHOdwpPr9McWtBIeDQhl7nsx8n0wPnLckJLGfeb7INjlUb0LYAMBwEAURzyb7LYy2gspHK8fV9Sqp/A1YKeCoO/oxwEeVy/kaa0Q6tJt0xynEtIj4t1oA3k0USkythS6Wpi9XFUIUEOiGqYCKpSyJiHXmQlGTvY137OrQgdAUbv+Vy4h14YH322C+TTgi15fXsr+N2YWcV3rmLCeyYiMrC8Ndsm8pzE/0BzI3toSNVlOD1SIo3kIjUo8zB0XfoH1Yvku+MOTESqz playpit
EOK
# go run checkup.go -c ansible/day2/tests/webapp-server.yml -w homeworks/day2
name: 3.1 Working with Filters
cases:
- global_env:
ANSIBLE_TRANSPORT: docker
ANSIBLE_FORCE_COLOR: True
ANSIBLE_TRANSPORT: local
SERVER: remotevm
name: 1.3 Tomcat
cases:
- global_env:
ANSIBLE_TRANSPORT: docker
ANSIBLE_FORCE_COLOR: True
# ANSIBLE_STRATEGY: mitogen_linear
# ANSIBLE_STRATEGY_PLUGINS: /tmp/mitogen-0.3.0rc1/ansible_mitogen/plugins/strategy
- script: |
docker run -d --name app-server --privileged quay.io/sbeliakou/ansible-training:centos
html, body, #terminal {
background: rgb(43, 43, 43);
height: 100%;
width: 100%;
padding: 0%;
margin: 0%;
}
html, body, #terminal {
background: rgb(43, 43, 43);
height: 100%;
width: 100%;
padding: 0%;
margin: 0%;
}

What variable???

- name: Installing webapp-server
  hosts: web-server

  vars:
    webapp_user: webapp-server
    webapp_group: webapp-server
- name: Installing Tomcat
  hosts: app-server
  become: yes

  vars:
    tomcat_user: tomcat
    tomcat_group: tomcat

    tomcat_version: 8.5.58
```yaml
- name: Installing Tomcat
hosts: app-server
become: yes
vars:
tomcat_user: tomcat
tomcat_group: tomcat
tomcat_version: 8.5.58
- hosts: centos
  tasks:
    - name: Install Httpd
      package: name=httpd state=installed
      become: yes

    - name: Copy httpd Configuration
      copy: src=index.html dest=/var/www/html/index.html