summarylogtreecommitdiffstats
path: root/rundeck.install
blob: b7b6610252621fa53f51de507d69e22c44a70ed5 (plain)
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
pre_install() {
    # Add rundeck group if not exists
    getent group rundeck >/dev/null || groupadd -r rundeck

    # Add rundeck user if not exists
    getent passwd rundeck >/dev/null || \
        useradd -r -g rundeck -d /var/lib/rundeck -s /bin/bash \
        -c "Rundeck user" rundeck
}

post_install() {
    # Ensure proper permissions
    chown -R rundeck:rundeck /var/lib/rundeck
    chown -R rundeck:rundeck /var/log/rundeck
    chown -R rundeck:rundeck /etc/rundeck
}

post_upgrade() {
    post_install
}

pre_remove() {
    systemctl stop rundeckd.service
    systemctl disable rundeckd.service
}

post_remove() {
    # Optionally remove rundeck user and group
    # Uncomment these lines if you want to remove the user/group on package removal
    userdel rundeck
    groupdel rundeck
    true
}