Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
01960e9
Update 02-Installation.md
claudedevops Nov 20, 2023
75055d1
Update provider.tf
claudedevops Nov 20, 2023
19d3a97
Update variables.tf
claudedevops Nov 20, 2023
c626865
Update provider.tf
claudedevops Nov 20, 2023
e00a628
Update null-resource.tf
claudedevops Nov 20, 2023
27a7f50
Update Type_module.md
claudedevops Nov 21, 2023
798faaa
Update Type_module.md
claudedevops Nov 22, 2023
a4a672f
Update Type_module.md
claudedevops Nov 22, 2023
7c16839
Update Type_module.md
claudedevops Nov 22, 2023
f910aa9
Update Type_module.md
claudedevops Nov 22, 2023
0c4930d
Update Type_module.md
claudedevops Nov 22, 2023
2595e49
Update Type_module.md
claudedevops Nov 22, 2023
beb0374
Update Type_module.md
claudedevops Nov 22, 2023
0ea8e82
Update Type_module.md
claudedevops Nov 22, 2023
4a18caa
Update Type_module.md
claudedevops Nov 22, 2023
a942c53
Update Type_module.md
claudedevops Nov 22, 2023
743892b
Update Type_module.md
claudedevops Nov 22, 2023
f18ce71
Update Type_module.md
claudedevops Nov 22, 2023
af1dbec
Update Type_module.md
claudedevops Nov 22, 2023
5fde46c
Update Type_module.md
claudedevops Nov 22, 2023
01ffa8b
Update Type_module.md
claudedevops Nov 22, 2023
702f237
Update ReadMe.md
claudedevops Nov 22, 2023
ab23979
Update Type_module.md
claudedevops Nov 23, 2023
ed3f310
Update Type_module.md
claudedevops Nov 23, 2023
8a1b75d
Update 03-Ansible_config_file.md
claudedevops Nov 23, 2023
60603fc
Update 03-Ansible_config_file.md
claudedevops Nov 23, 2023
d7b85e7
Update 03-Ansible_config_file.md
claudedevops Nov 23, 2023
f07bd41
Update 03-Ansible_config_file.md
claudedevops Nov 23, 2023
80c19e7
Update 03-Ansible_config_file.md
claudedevops Nov 23, 2023
cde2ce6
Update 03-Ansible_config_file.md
claudedevops Nov 23, 2023
bbd609c
Merge pull request #1 from LandmakTechnology/main
claudedevops Jan 23, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion 01-Introduction/02-Installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ have python2 or python3 installed on them.
$ pip3 install ansible --user
```

**Script to add user, password and enable password authentication**
**Script (for remote nodes) to add user, password and enable password authentication**
```
#!/bin/bash
$ sudo useradd -d /home/ansible -s /bin/bash -m ansible
Expand Down
7 changes: 6 additions & 1 deletion 01-Introduction/03-Ansible_config_file.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,12 @@
- But we can define ansible configuration file in different location
and for this there is a priority for this files.
- You can generate ansible.cfg by running the command
$ ansible-config init --disabled > ansible.cfg

**ansible-config init --disabled > ansible.cfg**

- Also you can now have a more complete file by including existing plugins:

**ansible-config init --disabled -t all > ansible.cfg**

**Locations with priority(starting from top to bottom):**
- ANSIBLE_CONFIG environment variable
Expand Down
2 changes: 1 addition & 1 deletion 01-Introduction/terraform files/null-resource.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ resource "null_resource" "vscode-config" {
host = aws_instance.ubuntu.public_ip
user = "ubuntu"
password = ""
private_key = file("~/Downloads/ansible-key.pem")
private_key = file("~/Downloads/AutomationKey.pem")
}

provisioner "file" {
Expand Down
4 changes: 2 additions & 2 deletions 01-Introduction/terraform files/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ variable "my_instance_type" {

variable "my_key" {
type = string
default = "ansible-key"
default = "AutomationKey"
}

variable "os" {
type = string
#default = "linux"
}
}
17 changes: 13 additions & 4 deletions 04-Ansible modules/Type_module.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ a) From ansible control node to remote node \
**$ ansible group1 -m copy -a "src=/source/file/path dest=/dest/location"** \
**$ ansible group1 -m copy -a "src=/etc/hosts dest=/home/ansible"**

b) From one location in remote node to another location in remote node \
b) From one location in remote node to another location in (same) remote node \
**$ ansible db -m copy -a “src=/source/file/path dest=/dest/location remote_src=yes"**

**$ ansible group1 -m copy -a "src=/etc/hosts dest=/home/ansible remote_src=yes"**
Expand Down Expand Up @@ -67,26 +67,35 @@ a) From ansible control node to remote node \

**$ ansible all -m service -a "name=nginx state=stopped" --become -K**

## **8. User Module**
## **8. User Module (Ansible3 00:56:18)**
- Used to create user accounts.
- Create a password encryption
- Generate the password from your local environment

**$ openssl passwd -crypt <desired_password>**

**On macOS, the openssl passwd -crypt command is not available by default in OpenSSL. The -crypt option is more commonly found on Linux systems.
However, you can achieve similar functionality using Python or Perl to generate a password hash with the crypt function. Here's an example using Python:*

**python -c 'import crypt,getpass; print(crypt.crypt(getpass.getpass(), crypt.mksalt(crypt.METHOD_CRYPT)))'**

**The above Python command will prompt you to enter the desired password, and it will output the hashed password* using the crypt method.

**Then to create the user and pass the decrypted password, run the following:*

**$ ansible db -m user -a "name=Peter password=wiyiMQbLhCRUY shell=/bin/bash" -b**

## **9. Setup module**
- This is a default module and is used to gather facts about the hosts.
- The setup module returns detailed information about the remote systems managed by Ansible, also known as system facts.
- To obtain the system facts for group1, run:

**$ ansible group1 -m setup**
**$ ansible groupName -m setup**

- This will print a large amount of JSON data containing details about the remote server environment.
- To print only the most relevant information, include the "gather_subset=min" argument as follows:

**$ ansible group1 -m setup -a "gather_subset=min"**
**$ ansible groupName -m setup -a "gather_subset=min"**

- To print only specific items of the JSON, you can use the filter argument. This will accept a wildcard pattern used to match strings. For example, to obtain information about both the ipv4 and ipv6 network interfaces, you can use *ipv* as filter:

Expand Down
5 changes: 3 additions & 2 deletions 05-Playbooks/ReadMe.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@
```
---
- name: sonarqube playbook
hosts: sonarqube become: yes
hosts: sonarqube
become: yes
tasks:
- name: install java
yum:
Expand All @@ -87,4 +88,4 @@
- name: start sonarqube
shell: sh /opt/sonarqube/sonarqube-7.8/bin/linux-x86-64/sonar.sh start become: yes
become_user: sonar
```
```