Files
@ 68b7e691f0e5
Branch filter:
Location: freifunk/Ansible-Configuration/initial_server_setup/initial_setup.yml - annotation
68b7e691f0e5
4.0 KiB
text/x-yaml
feat: main README.md, add `authorized_keys`
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 | 1fa2261908ab 1fa2261908ab 1fa2261908ab 1fa2261908ab 1fa2261908ab 1fa2261908ab 1fa2261908ab 1fa2261908ab 1fa2261908ab 1fa2261908ab 1fa2261908ab 1fa2261908ab 1fa2261908ab 1fa2261908ab 1fa2261908ab 1fa2261908ab 1fa2261908ab 1fa2261908ab 1fa2261908ab 1fa2261908ab 1fa2261908ab 1fa2261908ab 1fa2261908ab 1fa2261908ab 1fa2261908ab 1fa2261908ab 1fa2261908ab 1fa2261908ab 1fa2261908ab 1fa2261908ab 1fa2261908ab 1fa2261908ab 1fa2261908ab 1fa2261908ab 1fa2261908ab 1fa2261908ab 1fa2261908ab 1fa2261908ab 1fa2261908ab 1fa2261908ab 1fa2261908ab 1fa2261908ab 1fa2261908ab 1fa2261908ab 1fa2261908ab 1fa2261908ab 1fa2261908ab 1fa2261908ab 1fa2261908ab 1fa2261908ab 1fa2261908ab 1fa2261908ab 1fa2261908ab 1fa2261908ab 1fa2261908ab 1fa2261908ab 1fa2261908ab 1fa2261908ab 1fa2261908ab 1fa2261908ab 1fa2261908ab 1fa2261908ab 1fa2261908ab 1fa2261908ab 1fa2261908ab 1fa2261908ab 1fa2261908ab 1fa2261908ab 1fa2261908ab 1fa2261908ab 1fa2261908ab 1fa2261908ab 1fa2261908ab 1fa2261908ab 1fa2261908ab 1fa2261908ab 1fa2261908ab 1fa2261908ab 1fa2261908ab 1fa2261908ab 1fa2261908ab 1fa2261908ab 1fa2261908ab 1fa2261908ab 1fa2261908ab 1fa2261908ab 1fa2261908ab 1fa2261908ab 1fa2261908ab 1fa2261908ab 1fa2261908ab 1fa2261908ab 1fa2261908ab 1fa2261908ab 1fa2261908ab 1fa2261908ab 1fa2261908ab 1fa2261908ab 1fa2261908ab 1fa2261908ab 1fa2261908ab 1fa2261908ab 1fa2261908ab 1fa2261908ab 1fa2261908ab 1fa2261908ab 1fa2261908ab 1fa2261908ab 1fa2261908ab 1fa2261908ab 1fa2261908ab 1fa2261908ab 1fa2261908ab 1fa2261908ab 1fa2261908ab 1fa2261908ab 1fa2261908ab 1fa2261908ab 1fa2261908ab 1fa2261908ab 1fa2261908ab 1fa2261908ab 1fa2261908ab 1fa2261908ab 1fa2261908ab | ---
# Defining the remote server where the package will be deployed
- hosts: test
remote_user: root
become: yes
become_method: sudo
vars:
password: Welcome1234
ipv4: var=hostvars[initial]['ansible_default_ipv4']['address']
old_hostname: filter=ansible_hostname
tasks:
# Update and install aptitude packadge
- name: "APT: Install aptitude package"
apt:
name: aptitude
force_apt_get: yes
- name: "Update packages"
apt:
update_cache: yes # apt-get update
upgrade: full
- name: UpdateRaw
shell: apt-get update -y
- name: UpgradeRaw
shell: apt-get upgrade -y
# Installing the sudo, git, vim and python3 packadges on ther servers
- name: Install a list of packages
apt:
pkg:
- sudo
- git
- vim
- python3
- python3-pip
# Updating all packages to their latest version
- name: Update all packages to their latest version
apt:
name: "*"
state: latest
# Change Hostname
- name: "Update Hostnames"
hostname:
name: "{{ new_hostname }}"
# Updaet /etc/hosts
- name: Make sure an IPV4 entry in /etc/hosts exists
lineinfile:
path: /etc/hosts
regexp: "^{{ ansible_default_ipv4.address }}"
line: "{{ ansible_default_ipv4.address }} {{ new_hostname }} {{ new_hostname }}.freifunk.lu"
state: present
tags: network,hostname,dns
- name: Make sure an IPV6 entry in /etc/hosts exists
lineinfile:
path: /etc/hosts
regexp: "^{{ ansible_default_ipv6.address }}"
line: "{{ ansible_default_ipv6.address }} {{ new_hostname }} {{ new_hostname }}.freifunk.lu"
state: present
tags: network,hostname,dns
# Create Freifunk Users
- name: Create a login user fantawams
user:
name: fantawams
password: "{{ password | password_hash('sha512') }}"
groups: # Empty by default, here we give it some groups
- sudo
state: present
shell: /bin/bash # Defaults to /bin/bash
system: no # Defaults to no
createhome: yes # Defaults to yes
home: /home/fantawams # Defaults to /home/<username>
- name: Create a login user orimpe
user:
name: orimpe
password: "{{ password | password_hash('sha512') }}"
groups: # Empty by default, here we give it some groups
- sudo
state: present
shell: /bin/bash # Defaults to /bin/bash
system: no # Defaults to no
createhome: yes # Defaults to yes
home: /home/orimpe # Defaults to /home/<username>
- name: Create a login user metalgamer
user:
name: metalgamer
password: "{{ password | password_hash('sha512') }}"
groups: # Empty by default, here we give it some groups
- sudo
state: present
shell: /bin/bash # Defaults to /bin/bash
system: no # Defaults to no
createhome: yes # Defaults to yes
home: /home/metalgamer # Defaults to /home/<username>
- name: Create a login user xbr
user:
name: xbr
password: "{{ password | password_hash('sha512') }}"
groups: # Empty by default, here we give it some groups
- sudo
state: present
shell: /bin/bash # Defaults to /bin/bash
system: no # Defaults to no
createhome: yes # Defaults to yes
home: /home/xbr # Defaults to /home/<username>
- name: Create a login user fflux
user:
name: fflux
password: "{{ password | password_hash('sha512') }}"
# groups: # Empty by default, here we give it some groups
state: present
shell: /bin/bash # Defaults to /bin/bash
system: no # Defaults to no
createhome: yes # Defaults to yes
home: /home/fflux # Defaults to /home/<username>
|