From: Hamatoma Date: Wed, 3 Sep 2025 12:32:33 +0000 (+0200) Subject: V0.1.6 CreateSysInfo, needed.tgz X-Git-Url: https://gitweb.hamatoma.de/?a=commitdiff_plain;h=6f4f63f594b79169542605ef145789c7aad70652;p=ansknife.git V0.1.6 CreateSysInfo, needed.tgz - CreateSysInfo: Network and Hw added - needed.tgz+extended.tgz: better choice, documented --- diff --git a/CHANGELOG.md b/CHANGELOG.md index 7ab4c0b..cc234d9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +# V0.1.6 CreateSysInfo, needed.tgz + +- CreateSysInfo: Network and Hw added +- needed.tgz+extended.tgz: better choice, documented + # V0.1.5 Docu mysql - 71_mysql.md: setting of a password for root diff --git a/README.md b/README.md index 6f7b7e5..56da14d 100644 --- a/README.md +++ b/README.md @@ -21,10 +21,10 @@ The server name may be "colibri", we take the name also for the new project. - start a playbook to create the project colibri: /home/workspace/ansible/colibri will be created ``` BASE=/home/workspace/ansible -GIT_REP=ssh://myserver.com/git/repo +GIT_REPO=https://codeberg.org/Hamatoma/ansknife.git PROJ=colibri cd $BASE -git clone $GIT_REP/ansknife.git +git clone $GIT_REPO cd ansknife ansible-playbook playbook/create_project -e project=$PROJ cd ../$PROJ diff --git a/playbooks.templates/i_10_basic.yaml b/playbooks.templates/i_10_basic.yaml index c7ef6d9..e2e4690 100644 --- a/playbooks.templates/i_10_basic.yaml +++ b/playbooks.templates/i_10_basic.yaml @@ -4,41 +4,53 @@ vars: hostname: "{{ inventory_hostname | regex_search('[0-9a-zA-Z_]+')}}" tasks: - - name: Prepare /media/trg directory - ansible.builtin.file: path=/media/trg state=directory - - name: Prepare /media/tmp directory - ansible.builtin.file: path=/media/trg state=directory - - name: Prepare /media/fs.cave directory - ansible.builtin.file: path=/media/fs.cave state=directory - - name: Prepare /media/fs.sys directory - ansible.builtin.file: path=/media/fs.sys state=directory - - name: Prepare /usr/local/bin directory - ansible.builtin.file: path=/usr/local/bin state=directory - - name: Prepare /usr/local/bin/local directory - ansible.builtin.file: path=/usr/local/bin/local state=directory - - name: Prepare /usr/share/pyrshell directory - ansible.builtin.file: path=/usr/share/pyrshell state=directory + - name: Prepare usable directories + ansible.builtin.file: + path: "{{ item }}" + state: directory + mode: "777" + with_items: + - /media/src + - /media/trg + - /media/tmp + - /media/fs.cave + - /media/fs.sys + - /usr/local/bin + - /usr/local/bin/local + - name: Symbolic link to local directory - ansible.builtin.file: src=/usr/local/bin/local dest=/usr/local/bin/{{hostname}} state=link + ansible.builtin.file: + src: /usr/local/bin/local + dest: "/usr/local/bin/{{ hostname }}" + state: link + - name: Unpack a tar into /usr/local/bin/local - ansible.builtin.unarchive: src=../resources/needed.tgz dest=/usr/local/bin + ansible.builtin.unarchive: + src: "../resources/needed.tgz" + dest: /usr/local/bin + - name: Symbolic link to /p - ansible.builtin.file: src=/usr/local/bin/std.profile dest=/p state=link - - name: Unpack a tar into /usr/share/pyrshell - ansible.builtin.unarchive: src=../resources/rsh.tgz dest=/usr/share/pyrshell + ansible.builtin.file: + src: /usr/local/bin/std.profile + dest: /p + state: link + - name: Create configuration directory - ansible.builtin.file: path=/etc/config state=directory mode=0700 + ansible.builtin.file: + path: /etc/config + state: directory + mode: "700" + - name: Create webapp.d - ansible.builtin.file: path=/etc/config/webapps.d state=directory mode=0700 - - name: Create directories in /media - ansible.builtin.file: path=/media/{{ item }} state=directory mode=0700 - with_items: [src, tmp, trg] - - name: install standard packages + ansible.builtin.file: + path: /etc/config/webapps.d + state: directory + mode: "700" + + - name: Install standard packages ansible.builtin.apt: name: "{{ item }}" state: present update_cache: true cache_valid_time: 3600 with_items: [htop, rsync, sudo, curl, iotop, jnettop, ssl-cert, ca-certificates, zram-tools, nfs-kernel-server, tmux] - - \ No newline at end of file diff --git a/playbooks/create_project.yaml b/playbooks/create_project.yaml index 60e29a7..6b22f74 100644 --- a/playbooks/create_project.yaml +++ b/playbooks/create_project.yaml @@ -30,7 +30,7 @@ dest: "{{ base_ansible }}/{{ project }}/resources/{{ item }}" force: yes state: link - with_items: [needed.tgz, rsh.tgz] + with_items: [needed.tgz] - name: build link to the templates.fix directory ansible.builtin.file: src: "../ansknife/templates.fix" diff --git a/resources/extended.tgz b/resources/extended.tgz new file mode 100644 index 0000000..ecfc829 Binary files /dev/null and b/resources/extended.tgz differ diff --git a/resources/needed.tgz b/resources/needed.tgz index a389986..5644c92 100644 Binary files a/resources/needed.tgz and b/resources/needed.tgz differ diff --git a/resources/rsh.tgz b/resources/rsh.tgz deleted file mode 100644 index 3ff6405..0000000 Binary files a/resources/rsh.tgz and /dev/null differ diff --git a/templates.fix/scripts/CreateSysInfo b/templates.fix/scripts/CreateSysInfo index 1d614ff..5ba5df9 100644 --- a/templates.fix/scripts/CreateSysInfo +++ b/templates.fix/scripts/CreateSysInfo @@ -90,6 +90,13 @@ function Zfs(){ zfs list -t snapshot >>$fn fi } +function Hw(){ + lshw | gzip > $DIR_INFO/lshw.txt.gz + lshw -short | gzip > $DIR_INFO/lshw_short.txt.gz +} +function Network(){ + ip addr >$DIR_INFO/ip_addr.txt +} function DoIt(){ local debug= $debug Packages @@ -100,6 +107,8 @@ function DoIt(){ $debug Zfs $debug SoftwareRaid $debug SmartMonitor + $debug Hw + $debug Network } function ShowConfig(){ echo "= Example of /usr/local/bin/local/CreateSysInfo.conf:" diff --git a/templates.vars/packages.yaml b/templates.vars/packages.yaml index ec8f0f2..1aae0c7 100644 --- a/templates.vars/packages.yaml +++ b/templates.vars/packages.yaml @@ -6,3 +6,4 @@ packages_list: - unrar-free - htop - smartmontools + - lshw