Answers for "javascript 1...n"

1

install ansible in ubuntu

On Fedora:
$ sudo dnf install ansible

On RHEL and CentOS:
$ sudo yum install ansible

On Ubuntu:
$ sudo apt-add-repository --yes --update ppa:ansible/ansible
$ sudo apt install ansible

Using PIP:
$ pip install --user ansible

On Alpine:
$ apk add ansible

sudo apt install ansible
Posted by: Guest on October-19-2020
4

Install ansible

On Fedora:
$ sudo dnf install ansible

On RHEL and CentOS:
$ sudo yum install ansible

On Ubuntu:
$ sudo apt-add-repository --yes --update ppa:ansible/ansible
$ sudo apt install ansible

Using PIP:
$ pip install --user ansible

On Alpine:
$ apk add ansible
Posted by: Guest on September-20-2020
1

ansible playbook webserver

- hosts: "webserver"
  tasks:
  - name: "installing webserver"
    package:
        name: "httpd"
        state: "present"
  - name: "copying index.html"
    copy:
        src: "~/index.html"
        dest: "/var/www/html/"
  - name: "starting httpd service"
    service:
        name: "httpd"
        state: "started"

  - name: "stopping firewalld service"
    service:
        name: "firewalld"
        state: "stopped"
Posted by: Guest on September-12-2020
0

ansible example playbook

---
- name: update web servers
  hosts: webservers
  remote_user: root

  tasks:
  - name: ensure apache is at the latest version
    yum:
      name: httpd
      state: latest
  - name: write the apache config file
    template:
      src: /srv/httpd.j2
      dest: /etc/httpd.conf

- name: update db servers
  hosts: databases
  remote_user: root

  tasks:
  - name: ensure postgresql is at the latest version
    yum:
      name: postgresql
      state: latest
  - name: ensure that postgresql is started
    service:
      name: postgresql
      state: started
Posted by: Guest on January-21-2021
6

es6 create array with increasing number

Array.from(Array(10).keys())
//=> [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
Posted by: Guest on April-22-2020
3

javascript fill array with range

function range(start, end) {
  return Array(end - start + 1).fill().map((_, idx) => start + idx)
}
var result = range(9, 18); // [9, 10, 11, 12, 13, 14, 15, 16, 17, 18]
console.log(result);
Posted by: Guest on March-29-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language