Giter Club home page Giter Club logo

cis-ubuntu's Introduction

To run the playbook from the master, make sure to share ~/.ssh/id_rsa.pub key of master to node in ~/.ssh/authorized_keys

Use the following command and checkout this repo

git clone https://github.com/deathrangerr/cis-ubuntu.git

Create a shell script and paste the following given content in the file

shell .sh

#!/bin/bash


node_ip=172.3.113.151
cat <<EOF >playbook.yml
---

- name: Harden Server
  hosts: client
  become: yes
  roles:
    - wakanda
EOF

cat <<EOF >inven
[client]
server1 ansible_host=$node_ip
[client:vars]
ansible_user=ubuntu
EOF

ansible-playbook -i inven playbook.yml



#ssh ubuntu@$node_ip export DEBIAN_FRONTEND=noninteractive
#ssh ubuntu@$node_ip sudo apt update -y
#ssh ubuntu@$node_ip sudo apt upgrade -y
#ssh ubuntu@$node_ip sudo apt install java-common -y
#ssh ubuntu@$node_ip wget -P /home/ubuntu wget https://d3pxv6yz143wms.cloudfront.net/8.222.10.1/java-1.8.0-amazon-corretto-jdk_8.222.10-1_amd64.deb
#ssh ubuntu@$node_ip sudo dpkg --install /home/ubuntu/java-1.8.0-amazon-corretto-jdk_8.222.10-1_amd64.deb
#ssh ubuntu@$node_ip sudo rm -rf /home/ubuntu/*

A inventory file to store your host [ansible node dns or ip ]

inven

[client]
server1 ansible_host=172.31.83.99
[client:vars]
ansible_user=ubuntu

A playbook to run the role

playbook.yml

---

- name: Harden Server
  hosts: client
  become: yes
  roles:
    - cis-ubuntu

cis-ubuntu's People

Contributors

deathrangerr avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.