Håvard Ose Nordstrand 3 년 전
부모
커밋
d7c858713a
3개의 변경된 파일18개의 추가작업 그리고 10개의 파일을 삭제
  1. 10 7
      config/automation/ansible.md
  2. 2 2
      config/iot-ha/raspberry-pi.md
  3. 6 1
      config/linux-server/applications.md

+ 10 - 7
config/automation/ansible.md

@@ -6,17 +6,20 @@ breadcrumbs:
 ---
 {% include header.md %}
 
-## Resources
+## Usage
 
-### General Networking
+### Ad Hoc
 
-- [Ansible network platform options](https://docs.ansible.com/ansible/latest/network/user_guide/platform_index.html)
-- [Ansible cli_config module](https://docs.ansible.com/ansible/latest/modules/cli_config_module.html)
+- Run module for host: `ansible all -i <host>, -m <module> [-a <module-arg>]`
+    - The comma after the host is required to treat it as a host list literal instead of an inventory file name.
+- Get facts (with optional filter): `ansible all -i <host>, -m setup -a 'filter=ansible_os_*'` (example fact filter)
 
-### Cisco
+### Playbooks
 
-- [Ansible IOS platform options](https://docs.ansible.com/ansible/latest/network/user_guide/platform_ios.html)
-- [Ansible ios_config module](https://docs.ansible.com/ansible/latest/modules/ios_config_module.html)
+- Basic: `ansible-playbook <playbook>`
+- Specify inventory file: `ansible-playbook -i <hosts> <playbook>`
+- Limit which groups/hosts to use (comma-separated): `ansible-playbook -l <group|host> <playbook>`
+- Limit which tasks to run using tags (comma-separated): `ansible-playbook -t <tag> <playbook>`
 
 ## Configuration
 

+ 2 - 2
config/iot-ha/raspberry-pi.md

@@ -20,11 +20,11 @@ breadcrumbs:
 1. Download ~~Raspbian~~ Raspberry Pi OS: [Operating system images (Raspberry Pi)](https://www.raspberrypi.org/software/operating-systems/)
     - If you don't need a desktop, use "Raspberry Pi OS Lite".
 1. Burn it to the SD card.
-    - Make sure the SD card is RPi-compatible: [SD Cards (Raspberry Pi)](https://www.raspberrypi.org/documentation/installation/sd-cards.md)
+    - Make sure the SD card is RasPi-compatible: [SD Cards (Raspberry Pi)](https://www.raspberrypi.org/documentation/installation/sd-cards.md)
     - Linux: `dd if=<img-file> of=<sd-dev> bs=4M conv=fdatasync status=progress`
     - Windows: Use Win32DiskImager.
     - Or use the official Raspberry Pi Imager.
-1. Mount the SD card in the RPi and power it on.
+1. Mount the SD card in the RasPi and power it on.
 
 ### Basic Setup (with Desktop Environment)
 

+ 6 - 1
config/linux-server/applications.md

@@ -147,13 +147,15 @@ See [Storage: Ceph](/config/linux-server/storage/#ceph).
 
 ## Chrony
 
+An NTP client and server. By design more accurate than e.g. ntpd and systemd-timesyncd.
+
 ### Setup (Server)
 
 1. Install: `apt install chrony`
 1. Modify config (`/etc/chrony/chrony.conf`):
     - (Optional) Add individual servers: `server <address> iburst`
     - (Optional) Add pool of servers (a name resolving to multiple servers): `pool <address> iburst`
-    - (Optional) Allow clients: `allow {all|<network>}`
+    - (Optional) Allow external clients: `allow {all|<network>}`
 1. Restart: `systemctl restart chrony`
 
 ### Usage
@@ -256,6 +258,7 @@ See [Home Assistant](/config/iot-ha/home-assistant/).
   If using range notation, try to align the start and end on a CIDR block to avoid excessive memory usage.
 - DHCPv6 uses lease pools of 9973 entries, so using range sizes below this number may be preferable as a very general reference.
   `/116` gives 8191 addresses.
+- Statements inside `pool[6]` are not applied to e.g. `host`s with addresses in the same defined subnet. Don't use `pool[6]`s if you don't need to.
 
 ## lm_sensors
 
@@ -385,6 +388,8 @@ Example `/etc/exports`:
 
 ## ntpd
 
+Note: I recommend [Chrony](#chrony) instead of ntpd. It's newer and by design more accurate.
+
 ### Setup
 
 1. Disable systemd-timesyncd NTP client by disabling and stopping `systemd-timesyncd`.