Linux/Virtual Server Setup Guide with Ansible: Difference between revisions

From Wiki
mNo edit summary
mNo edit summary
 
(16 intermediate revisions by the same user not shown)
Line 1: Line 1:
== Step 1: Prepare local linux terminal ==
== Step 1: Prepare local linux terminal ==
* Install Windows Subsystem for Linux / Ubuntu
* Install Windows Subsystem for Linux / Ubuntu
* Open local linux terminal and complete initial setup
* Install Ansible:
* Install Ansible:
<blockquote>
<blockquote><pre>
<pre>
sudo apt -y install software-properties-common
sudo apt -y install software-properties-common
sudo apt-add-repository ppa:ansible/ansible
sudo apt-add-repository ppa:ansible/ansible
Line 9: Line 9:
</pre>
</pre>
</blockquote>
</blockquote>
== Step 2: Generate Cloud VM (Hetzner, Netcup,...) ==
* Install latest Ubuntu LTS
* Set username / password
* Write down information required for next steps:
** VM IP, VM username, VM password
== Step 3: Adjust DNS entries ==
* Make sure the desired DNS entries point to the (new?) IP of the VM. (IPv4 + IPv6)
* Verify from the local terminal that the DNS entry is pointing to the correct ip
<blockquote>
<pre>
nslookup {hostname}
</pre>
</blockquote>
== Step  4: Set up VM with ansible ==
* Open local linux terminal
* Get repository with Ansible files:
* Get repository with Ansible files:
<blockquote>
<blockquote>
Line 16: Line 35:
</pre>
</pre>
</blockquote>
</blockquote>
* check configuration files
* edit and adjust <u>.env</u>
* execute .sh scripts (top to bottom)
<blockquote>
 
<pre>
 
cp .env.example .env
nano .env
</pre>
</blockquote>
* execute setup scripts
<blockquote>
<pre>
./00_setup-ssh.sh
./run_playbooks.sh
</pre>
</blockquote>


[[Category:Linux/Deployment]]
[[Category:Linux/Deployment]]
[[Category:Linux]]
[[Category:Linux]]

Latest revision as of 20:34, 26 November 2023

Step 1: Prepare local linux terminal

  • Install Windows Subsystem for Linux / Ubuntu
  • Open local linux terminal and complete initial setup
  • Install Ansible:
sudo apt -y install software-properties-common
sudo apt-add-repository ppa:ansible/ansible
sudo apt install ansible

Step 2: Generate Cloud VM (Hetzner, Netcup,...)

  • Install latest Ubuntu LTS
  • Set username / password
  • Write down information required for next steps:
    • VM IP, VM username, VM password

Step 3: Adjust DNS entries

  • Make sure the desired DNS entries point to the (new?) IP of the VM. (IPv4 + IPv6)
  • Verify from the local terminal that the DNS entry is pointing to the correct ip
nslookup {hostname}

Step 4: Set up VM with ansible

  • Open local linux terminal
  • Get repository with Ansible files:
git clone https://{ansible-library}
cd ansible-library
  • edit and adjust .env
cp .env.example .env
nano .env
  • execute setup scripts
./00_setup-ssh.sh
./run_playbooks.sh