Files
@ 31778396563a
Branch filter:
Location: freifunk/Ansible-Configuration/initial_setup.yml - annotation
31778396563a
3.4 KiB
text/x-yaml
Ansible Playbook for initial setup. Hostname part does not work.
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 | 31778396563a 31778396563a 31778396563a 31778396563a 31778396563a 31778396563a 31778396563a 31778396563a 31778396563a 31778396563a 31778396563a 31778396563a 31778396563a 31778396563a 31778396563a 31778396563a 31778396563a 31778396563a 31778396563a 31778396563a 31778396563a 31778396563a 31778396563a 31778396563a 31778396563a 31778396563a 31778396563a 31778396563a 31778396563a 31778396563a 31778396563a 31778396563a 31778396563a 31778396563a 31778396563a 31778396563a 31778396563a 31778396563a 31778396563a 31778396563a 31778396563a 31778396563a 31778396563a 31778396563a 31778396563a 31778396563a 31778396563a 31778396563a 31778396563a 31778396563a 31778396563a 31778396563a 31778396563a 31778396563a 31778396563a 31778396563a 31778396563a 31778396563a 31778396563a 31778396563a 31778396563a 31778396563a 31778396563a 31778396563a 31778396563a 31778396563a 31778396563a 31778396563a 31778396563a 31778396563a 31778396563a 31778396563a 31778396563a 31778396563a 31778396563a 31778396563a 31778396563a 31778396563a 31778396563a 31778396563a 31778396563a 31778396563a 31778396563a 31778396563a 31778396563a 31778396563a 31778396563a 31778396563a 31778396563a 31778396563a 31778396563a 31778396563a 31778396563a 31778396563a 31778396563a 31778396563a 31778396563a 31778396563a 31778396563a 31778396563a 31778396563a 31778396563a 31778396563a 31778396563a 31778396563a 31778396563a 31778396563a 31778396563a 31778396563a 31778396563a 31778396563a 31778396563a | ---
# Defining the remote server where the package will be deployed
- hosts: initial
remote_user: root
become: yes
become_method: sudo
vars:
password: Welcome1234
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 }}"
- name: 'Add hostname to /etc/hosts'
lineinfile:
path: /etc/hosts
regexp: '^127\.0\.0\.1[ \t]+localhost'
line: '127.0.0.1 localhost {{ new_hostname }}'
state: present
# 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>
|